Spaces:
Runtime error
Runtime error
Update src/music/pipeline/audio2midi.py
Browse files
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
|