ccolas commited on
Commit
e9d7c26
1 Parent(s): 5069f56

Update src/music/pipeline/music_pipeline.py

Browse files
src/music/pipeline/music_pipeline.py CHANGED
@@ -7,6 +7,7 @@ from src.music.config import RANDOM_CROP, NB_AUG, FROM_URL_PATH
7
  # from src.music.pipeline.synth2audio import AudioRecorder
8
  # from src.music.pipeline.processed2handcodedrep import processed2handcodedrep
9
  import time
 
10
 
11
  VERBOSE = True
12
  AUGMENTATION, NOISE_INJECTED = False, False
@@ -64,7 +65,11 @@ def encode_music(url=None,
64
  # assert handcoded_rep_path is not None and representation_path is not None
65
  all_paths = dict(url=url, audio_path=audio_path, midi_path=midi_path, processed_path=processed_path, encoded_path=encoded_path,
66
  representation_path=representation_path, handcoded_rep_path=handcoded_rep_path)
67
-
 
 
 
 
68
  if verbose: print(' ' * (level + 2) + f'Music processed in {int(time.time() - init_time)} seconds.')
69
  except:
70
  if verbose: print(' ' * (level + 2) + f'Music FAILED to process in {int(time.time() - init_time)} seconds.')
 
7
  # from src.music.pipeline.synth2audio import AudioRecorder
8
  # from src.music.pipeline.processed2handcodedrep import processed2handcodedrep
9
  import time
10
+ import hashlib
11
 
12
  VERBOSE = True
13
  AUGMENTATION, NOISE_INJECTED = False, False
 
65
  # assert handcoded_rep_path is not None and representation_path is not None
66
  all_paths = dict(url=url, audio_path=audio_path, midi_path=midi_path, processed_path=processed_path, encoded_path=encoded_path,
67
  representation_path=representation_path, handcoded_rep_path=handcoded_rep_path)
68
+ print('audio hash: ', hashlib.md5(open(audio_path, 'rb').read()).hexdigest())
69
+ print('midi hash: ', hashlib.md5(open(midi_path, 'rb').read()).hexdigest())
70
+ print('processed hash: ', hashlib.md5(open(processed_path, 'rb').read()).hexdigest())
71
+ print('encoded hash: ', hashlib.md5(open(encoded_path, 'rb').read()).hexdigest())
72
+ print('rep hash: ', hashlib.md5(open(representation_path, 'rb').read()).hexdigest())
73
  if verbose: print(' ' * (level + 2) + f'Music processed in {int(time.time() - init_time)} seconds.')
74
  except:
75
  if verbose: print(' ' * (level + 2) + f'Music FAILED to process in {int(time.time() - init_time)} seconds.')