ccolas commited on
Commit
1a5d300
1 Parent(s): db98530

Update src/music/pipeline/audio2midi.py

Browse files
Files changed (1) hide show
  1. src/music/pipeline/audio2midi.py +1 -1
src/music/pipeline/audio2midi.py CHANGED
@@ -33,8 +33,8 @@ def audio2midi(audio_path, midi_path=None, crop=CROP_LEN, random_crop=True, verb
33
  if isinstance(crop, int) and len(audio) > FPS * crop:
34
  rc_str = ' (random crop)' if random_crop else ' (start crop)'
35
  if verbose: print(' ' * (level + 2) + f'Cropping the song to {crop}s before transcription{rc_str}. ')
 
36
  if random_crop:
37
- size_crop = FPS * crop
38
  index_begining = np.random.randint(len(audio) - size_crop - 1)
39
  else:
40
  index_begining = 0
 
33
  if isinstance(crop, int) and len(audio) > FPS * crop:
34
  rc_str = ' (random crop)' if random_crop else ' (start crop)'
35
  if verbose: print(' ' * (level + 2) + f'Cropping the song to {crop}s before transcription{rc_str}. ')
36
+ size_crop = FPS * crop
37
  if random_crop:
 
38
  index_begining = np.random.randint(len(audio) - size_crop - 1)
39
  else:
40
  index_begining = 0