diff --git a/examples/audio/md/stft.md b/examples/audio/md/stft.md index 6f898ae474..08c6d42001 100644 --- a/examples/audio/md/stft.md +++ b/examples/audio/md/stft.md @@ -605,7 +605,7 @@ plt.show() -![png](https://github.com/mostafa-mahmoud/keras-io/blob/master/examples/audio/img/stft/raw_audio.png) +![png](https://github.com/keras-team/keras-io/blob/master/examples/audio/img/stft/raw_audio.png) @@ -618,7 +618,7 @@ plot_single_spectrogram(sample_wav_data) -![png](https://github.com/mostafa-mahmoud/keras-io/blob/master/examples/audio/img/stft/spectrogram.png) +![png](https://github.com/keras-team/keras-io/blob/master/examples/audio/img/stft/spectrogram.png) @@ -631,7 +631,7 @@ plot_multi_bandwidth_spectrogram(sample_wav_data) -![png](https://github.com/mostafa-mahmoud/keras-io/blob/master/examples/audio/img/stft/multiband_spectrogram.png) +![png](https://github.com/keras-team/keras-io/blob/master/examples/audio/img/stft/multiband_spectrogram.png) @@ -643,9 +643,7 @@ def read_dataset(df, folds): msk = df["fold"].isin(folds) filenames = df["filename"][msk] targets = df["target"][msk].values - waves = np.array( - [read_wav_file(fil) for fil in filenames], dtype=np.float32 - ) + waves = np.array([read_wav_file(fil) for fil in filenames], dtype=np.float32) return waves, targets ``` @@ -1790,7 +1788,7 @@ plt.show() -![png](https://github.com/mostafa-mahmoud/keras-io/blob/master/examples/audio/img/stft/training.png) +![png](https://github.com/keras-team/keras-io/blob/master/examples/audio/img/stft/training.png) @@ -1802,9 +1800,7 @@ Running the models on the test set. ```python _, test_acc = model1d.evaluate(test_x, test_y) -print( - f"1D model wit non-trainable STFT -> Test Accuracy: {test_acc * 100:.2f}%" -) +print(f"1D model wit non-trainable STFT -> Test Accuracy: {test_acc * 100:.2f}%") ``` 3/3 ━━━━━━━━━━━━━━━━━━━━ 3s 307ms/step - accuracy: 0.8148 - loss: 0.6244 diff --git a/templates/examples/audio/stft.md b/templates/examples/audio/stft.md index 7fe77f719a..de73a0453d 100644 --- a/templates/examples/audio/stft.md +++ b/templates/examples/audio/stft.md @@ -6,6 +6,7 @@ **Description:** Introducing the `STFTSpectrogram` layer to extract spectrograms for audio classification. +
ⓘ This example uses Keras 3
[**View in Colab**](https://colab.research.google.com/github/keras-team/keras-io/blob/master/examples/audio/ipynb/stft.ipynb) [**GitHub source**](https://github.com/keras-team/keras-io/blob/master/examples/audio/stft.py) @@ -52,7 +53,6 @@ import scipy.io.wavfile from keras import layers from scipy.signal import resample -np.random.seed(41) keras.utils.set_random_seed(41) ``` @@ -606,7 +606,7 @@ plt.show() -![png](https://github.com/mostafa-mahmoud/keras-io/blob/master/examples/audio/img/stft/raw_audio.png) +![png](https://github.com/keras-team/keras-io/blob/master/examples/audio/img/stft/raw_audio.png) @@ -619,7 +619,7 @@ plot_single_spectrogram(sample_wav_data) -![png](https://github.com/mostafa-mahmoud/keras-io/blob/master/examples/audio/img/stft/spectrogram.png) +![png](https://github.com/keras-team/keras-io/blob/master/examples/audio/img/stft/spectrogram.png) @@ -632,7 +632,7 @@ plot_multi_bandwidth_spectrogram(sample_wav_data) -![png](https://github.com/mostafa-mahmoud/keras-io/blob/master/examples/audio/img/stft/multiband_spectrogram.png) +![png](https://github.com/keras-team/keras-io/blob/master/examples/audio/img/stft/multiband_spectrogram.png) @@ -644,9 +644,7 @@ def read_dataset(df, folds): msk = df["fold"].isin(folds) filenames = df["filename"][msk] targets = df["target"][msk].values - waves = np.array( - [read_wav_file(fil) for fil in filenames], dtype=np.float32 - ) + waves = np.array([read_wav_file(fil) for fil in filenames], dtype=np.float32) return waves, targets ``` @@ -1791,7 +1789,7 @@ plt.show() -![png](https://github.com/mostafa-mahmoud/keras-io/blob/master/examples/audio/img/stft/training.png) +![png](https://github.com/keras-team/keras-io/blob/master/examples/audio/img/stft/training.png) @@ -1803,9 +1801,7 @@ Running the models on the test set. ```python _, test_acc = model1d.evaluate(test_x, test_y) -print( - f"1D model wit non-trainable STFT -> Test Accuracy: {test_acc * 100:.2f}%" -) +print(f"1D model wit non-trainable STFT -> Test Accuracy: {test_acc * 100:.2f}%") ``` 3/3 ━━━━━━━━━━━━━━━━━━━━ 3s 307ms/step - accuracy: 0.8148 - loss: 0.6244