From 87319211a847086bd186515c59703c28f464b55f Mon Sep 17 00:00:00 2001 From: Pierre Mahe <pierre.mahe@lis-lab.fr> Date: Tue, 26 Sep 2023 15:52:03 +0200 Subject: [PATCH] "bugfix : corrige le calcule des offsets. si len(sig) - args.lensample < 0.01 " --- run_CNN.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_CNN.py b/run_CNN.py index e15d1df..cdeca01 100644 --- a/run_CNN.py +++ b/run_CNN.py @@ -35,7 +35,7 @@ class Dataset(torch.utils.data.Dataset): try: info = sf.info(os.path.join(args.audio_folder, fn)) duration, fs = info.duration, info.samplerate - self.samples.extend([{'fn':fn, 'offset':offset, 'fs':fs} for offset in np.arange(0, duration+.01 - args.lensample, args.lensample)]) + self.samples.extend([{'fn':fn, 'offset':offset, 'fs':fs} for offset in np.arange(0, duration+1e-10 - args.lensample, args.lensample)]) except: continue assert info.channels > args.channel, f"The desired channel is unavailable for the audio file {fn}" -- GitLab