From d99cc459986ef2a34beee19fc17c6bcbc7a26c18 Mon Sep 17 00:00:00 2001 From: "Y.D.X" <73375426+YDX-2147483647@users.noreply.github.com> Date: Wed, 20 Jul 2022 12:48:28 +0800 Subject: [PATCH 1/5] Fix deprecation/future warnings in notebook 211 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - [`waveplot` is deprecated in favor of `waveshow` since librosa v0.9.](https://librosa.org/doc/latest/changelog.html?highlight=waveplot#v0-8-1) Note that `max_sr` in [`waveplot`](http://librosa.org/doc/0.8.1/generated/librosa.display.waveplot.html?highlight=max_sr#librosa.display.waveplot) is removed. `max_sr` controls how signals are down-sampled if they’re too long. (`waveplot` uses “a downsampled amplitude envelope” instead) - `librosa.filters.mel` in `audio_to_mel` FutureWarning: Pass `sr=16000, n_fft=512` as keyword args. From version 0.10 passing these as positional arguments will result in an error. --- notebooks/211-speech-to-text/211-speech-to-text.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notebooks/211-speech-to-text/211-speech-to-text.ipynb b/notebooks/211-speech-to-text/211-speech-to-text.ipynb index 5b141111484..82bf461571a 100644 --- a/notebooks/211-speech-to-text/211-speech-to-text.ipynb +++ b/notebooks/211-speech-to-text/211-speech-to-text.ipynb @@ -229,7 +229,7 @@ "outputs": [], "source": [ "plt.figure()\n", - "librosa.display.waveplot(y=audio, sr=sampling_rate, max_points=50000.0, x_axis='time', offset=0.0, max_sr=1000);\n", + "librosa.display.waveshow(y=audio, sr=sampling_rate, max_points=50000.0, x_axis='time', offset=0.0);\n", "plt.show()\n", "specto_audio = librosa.stft(audio)\n", "specto_audio = librosa.amplitude_to_db(np.abs(specto_audio), ref=np.max)\n", @@ -288,7 +288,7 @@ " win_length=win_length, center=True, window=scipy.signal.windows.hann(win_length), pad_mode='reflect'))\n", "\n", " # Create mel filter-bank, produce transformation matrix to project current values onto Mel-frequency bins.\n", - " mel_basis = librosa.filters.mel(sampling_rate, 512, n_mels=64, fmin=0.0, fmax=8000.0, htk=False)\n", + " mel_basis = librosa.filters.mel(sr=sampling_rate, n_fft=512, n_mels=64, fmin=0.0, fmax=8000.0, htk=False)\n", " return mel_basis, spec\n", "\n", "\n", From e70b12c690aedd8e78fa23927ed03e57e04c6537 Mon Sep 17 00:00:00 2001 From: "Y.D.X" <73375426+YDX-2147483647@users.noreply.github.com> Date: Thu, 21 Jul 2022 11:47:06 +0800 Subject: [PATCH 2/5] Fix `waveshow` Speech to text notebook 211 `max_points` should be an `int`, not `float`. --- notebooks/211-speech-to-text/211-speech-to-text.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebooks/211-speech-to-text/211-speech-to-text.ipynb b/notebooks/211-speech-to-text/211-speech-to-text.ipynb index 82bf461571a..04107465380 100644 --- a/notebooks/211-speech-to-text/211-speech-to-text.ipynb +++ b/notebooks/211-speech-to-text/211-speech-to-text.ipynb @@ -229,7 +229,7 @@ "outputs": [], "source": [ "plt.figure()\n", - "librosa.display.waveshow(y=audio, sr=sampling_rate, max_points=50000.0, x_axis='time', offset=0.0);\n", + "librosa.display.waveshow(y=audio, sr=sampling_rate, max_points=50000, x_axis='time', offset=0.0);\n", "plt.show()\n", "specto_audio = librosa.stft(audio)\n", "specto_audio = librosa.amplitude_to_db(np.abs(specto_audio), ref=np.max)\n", From ad9bd14bdd56136229743e7fb260c7752106af99 Mon Sep 17 00:00:00 2001 From: "Y.D.X" <73375426+YDX-2147483647@users.noreply.github.com> Date: Thu, 28 Jul 2022 11:54:10 +0800 Subject: [PATCH 3/5] add librosa to requirements --- .docker/Pipfile | 1 + requirements.txt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.docker/Pipfile b/.docker/Pipfile index 3b0cf1fec52..a0751f17866 100644 --- a/.docker/Pipfile +++ b/.docker/Pipfile @@ -17,6 +17,7 @@ jupyter-nbrequirements = "*" jupyterhub = "==2.2.*" jupyterlab = "*" jupyterlab-git = "==0.30" +librosa = ">=0.8.1" matplotlib = "<3.4" monai = "*" nbval = "*" diff --git a/requirements.txt b/requirements.txt index e4126ac81b2..0d3490b7855 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,6 +25,9 @@ paddlehub paddle2onnx>=0.6, <=0.9.6 ppgan==2.1.* +# Audio analysis requirements +librosa>=0.8.1 + # BERT quantization notebook requirements transformers From 36e78644644715745a7d0bf8fa50d818e2be8a70 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 29 Jul 2022 12:41:15 +0200 Subject: [PATCH 4/5] Update .docker/Pipfile --- .docker/Pipfile | 1 - 1 file changed, 1 deletion(-) diff --git a/.docker/Pipfile b/.docker/Pipfile index a0751f17866..3b0cf1fec52 100644 --- a/.docker/Pipfile +++ b/.docker/Pipfile @@ -17,7 +17,6 @@ jupyter-nbrequirements = "*" jupyterhub = "==2.2.*" jupyterlab = "*" jupyterlab-git = "==0.30" -librosa = ">=0.8.1" matplotlib = "<3.4" monai = "*" nbval = "*" From 43b4b74f8b3713099e692d18106edc910be36d57 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 29 Jul 2022 12:41:20 +0200 Subject: [PATCH 5/5] Update requirements.txt --- requirements.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0d3490b7855..e4126ac81b2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,9 +25,6 @@ paddlehub paddle2onnx>=0.6, <=0.9.6 ppgan==2.1.* -# Audio analysis requirements -librosa>=0.8.1 - # BERT quantization notebook requirements transformers