Commit 1152e5d7 authored by Martin Lebourdais's avatar Martin Lebourdais
Browse files

removal of the bad print

parent 476a1625
...@@ -388,22 +388,28 @@ class SeqSet(Dataset): ...@@ -388,22 +388,28 @@ class SeqSet(Dataset):
# Randomly pick an audio chunk within the current segment # Randomly pick an audio chunk within the current segment
while not ok: while not ok:
try: try:
ok=True ok=True
start = random.uniform(seg["start"], seg["start"] + self.duration) start = random.uniform(seg["start"], seg["start"] + self.duration)
sig = numpy.array([0,0])
sig, _ = soundfile.read(self.wav_dir + seg["show"] + ".wav", try:
start=int(start * self.audio_framerate), sig, _ = soundfile.read(self.wav_dir + seg["show"] + ".wav",
stop=int((start + self.duration) * self.audio_framerate) start=int(start * self.audio_framerate),
stop=int((start + self.duration) * self.audio_framerate),
) )
except RuntimeError:
print("==============="+self.wav_dir+seg["show"]+".flac")
sig += 0.0001 * numpy.random.randn(sig.shape[0]) sig += 0.0001 * numpy.random.randn(sig.shape[0])
if self.transform_pipeline: if self.transform_pipeline:
sig, speaker_idx,_t, _s = self.transforms((sig, None, None, None, None, None)) sig, speaker_idx,_t, _s = self.transforms((sig, None, None, None, None, None))
except ValueError as e: except ValueError as e:
ok=False ok=False
# sig, speaker_idx, _, __, _t, _s = self.transforms((sig, None, None, None, None, None)) # sig, speaker_idx, _, __, _t, _s = self.transforms((sig, None, None, None, None, None))
if sig.T.shape != (198,30): if sig.T.shape != (198,30):
print(sig.T.shape) #problem of dimension idk why ?
ok=False ok=False
tmp_label,overlaps = mdtm_to_label(mdtm_filename=self.mdtm_dir + seg["show"] + ".mdtm", tmp_label,overlaps = mdtm_to_label(mdtm_filename=self.mdtm_dir + seg["show"] + ".mdtm",
start_time=start, start_time=start,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment