diff --git a/utils.py b/utils.py index bab268fdb36927a22f535f0ccfeb43c3bb3d9059..29550eaecad2961e605657a8b9f3ace12b100927 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 358ce90df0f9948b0c3a7fdc8bccda78fa17e52e..5c351a82c068155edbbed51fb63a657a1cb1110e 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)