From 80b157de63aa0eb556f2ff77ba35b290535fac6a Mon Sep 17 00:00:00 2001 From: Stephane Chavin <stephane.chavin@lis-lab.fr> Date: Sun, 21 Jul 2024 21:47:48 +0200 Subject: [PATCH] remove vmin spectro --- utils.py | 2 +- yolov5/utils/dataloaders.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils.py b/utils.py index bab268f..29550ea 100755 --- a/utils.py +++ b/utils.py @@ -109,7 +109,7 @@ def create_spectrogram(sig, directory, names, cmap, window_size=1024, overlap=.5 fig = plt.figure() # plot the spectrogram plt.imshow(stft[::-1], aspect='auto', - interpolation=None, cmap=cmap, vmin=stft.mean()) + interpolation=None, cmap=cmap) # you can add : vmin=stft.mean()) # Remove all the borders around the plot plt.subplots_adjust(top=1, bottom=0, left=0, right=1) if names: diff --git a/yolov5/utils/dataloaders.py b/yolov5/utils/dataloaders.py index 358ce90..5c351a8 100755 --- a/yolov5/utils/dataloaders.py +++ b/yolov5/utils/dataloaders.py @@ -291,7 +291,7 @@ class LoadSpectros: hop_length=hop, window='hann') # Compute the STFT stft = np.log10(np.abs(stft)) axim = plt.imshow(stft, aspect = "auto", interpolation = None, - cmap = self.cmap, vmin=np.mean(stft)) + cmap = self.cmap) # you can add : vmin=np.mean(stft)) plt.subplots_adjust(top=1, bottom=0, left=0, right=1) im0 = axim.make_image(fig.canvas)[0][:,:,:-1][:,:,::-1] cv2.imwrite(path, im0) -- GitLab