Skip to content

Commit 5f278fd

Browse files
In the STFT tutorial, take the images from the keras-team/keras-io repo instead of a personal repository. (#1958)
1 parent c91cce7 commit 5f278fd

File tree

2 files changed

+13
-21
lines changed

2 files changed

+13
-21
lines changed

examples/audio/md/stft.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ plt.show()
605605

606606

607607

608-
![png](https://github.com/mostafa-mahmoud/keras-io/blob/master/examples/audio/img/stft/raw_audio.png)
608+
![png](https://github.com/keras-team/keras-io/blob/master/examples/audio/img/stft/raw_audio.png)
609609

610610

611611

@@ -618,7 +618,7 @@ plot_single_spectrogram(sample_wav_data)
618618

619619

620620

621-
![png](https://github.com/mostafa-mahmoud/keras-io/blob/master/examples/audio/img/stft/spectrogram.png)
621+
![png](https://github.com/keras-team/keras-io/blob/master/examples/audio/img/stft/spectrogram.png)
622622

623623

624624

@@ -631,7 +631,7 @@ plot_multi_bandwidth_spectrogram(sample_wav_data)
631631

632632

633633

634-
![png](https://github.com/mostafa-mahmoud/keras-io/blob/master/examples/audio/img/stft/multiband_spectrogram.png)
634+
![png](https://github.com/keras-team/keras-io/blob/master/examples/audio/img/stft/multiband_spectrogram.png)
635635

636636

637637

@@ -643,9 +643,7 @@ def read_dataset(df, folds):
643643
msk = df["fold"].isin(folds)
644644
filenames = df["filename"][msk]
645645
targets = df["target"][msk].values
646-
waves = np.array(
647-
[read_wav_file(fil) for fil in filenames], dtype=np.float32
648-
)
646+
waves = np.array([read_wav_file(fil) for fil in filenames], dtype=np.float32)
649647
return waves, targets
650648
```
651649

@@ -1790,7 +1788,7 @@ plt.show()
17901788

17911789

17921790

1793-
![png](https://github.com/mostafa-mahmoud/keras-io/blob/master/examples/audio/img/stft/training.png)
1791+
![png](https://github.com/keras-team/keras-io/blob/master/examples/audio/img/stft/training.png)
17941792

17951793

17961794

@@ -1802,9 +1800,7 @@ Running the models on the test set.
18021800

18031801
```python
18041802
_, test_acc = model1d.evaluate(test_x, test_y)
1805-
print(
1806-
f"1D model wit non-trainable STFT -> Test Accuracy: {test_acc * 100:.2f}%"
1807-
)
1803+
print(f"1D model wit non-trainable STFT -> Test Accuracy: {test_acc * 100:.2f}%")
18081804
```
18091805

18101806
3/3 ━━━━━━━━━━━━━━━━━━━━ 3s 307ms/step - accuracy: 0.8148 - loss: 0.6244

templates/examples/audio/stft.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
**Description:** Introducing the `STFTSpectrogram` layer to extract spectrograms for audio classification.
77

88

9+
<div class='example_version_banner keras_3'>ⓘ This example uses Keras 3</div>
910
<img class="k-inline-icon" src="https://colab.research.google.com/img/colab_favicon.ico"/> [**View in Colab**](https://colab.research.google.com/github/keras-team/keras-io/blob/master/examples/audio/ipynb/stft.ipynb) <span class="k-dot">•</span><img class="k-inline-icon" src="https://github.com/favicon.ico"/> [**GitHub source**](https://github.com/keras-team/keras-io/blob/master/examples/audio/stft.py)
1011

1112

@@ -52,7 +53,6 @@ import scipy.io.wavfile
5253
from keras import layers
5354
from scipy.signal import resample
5455

55-
np.random.seed(41)
5656
keras.utils.set_random_seed(41)
5757
```
5858

@@ -606,7 +606,7 @@ plt.show()
606606

607607

608608

609-
![png](https://github.com/mostafa-mahmoud/keras-io/blob/master/examples/audio/img/stft/raw_audio.png)
609+
![png](https://github.com/keras-team/keras-io/blob/master/examples/audio/img/stft/raw_audio.png)
610610

611611

612612

@@ -619,7 +619,7 @@ plot_single_spectrogram(sample_wav_data)
619619

620620

621621

622-
![png](https://github.com/mostafa-mahmoud/keras-io/blob/master/examples/audio/img/stft/spectrogram.png)
622+
![png](https://github.com/keras-team/keras-io/blob/master/examples/audio/img/stft/spectrogram.png)
623623

624624

625625

@@ -632,7 +632,7 @@ plot_multi_bandwidth_spectrogram(sample_wav_data)
632632

633633

634634

635-
![png](https://github.com/mostafa-mahmoud/keras-io/blob/master/examples/audio/img/stft/multiband_spectrogram.png)
635+
![png](https://github.com/keras-team/keras-io/blob/master/examples/audio/img/stft/multiband_spectrogram.png)
636636

637637

638638

@@ -644,9 +644,7 @@ def read_dataset(df, folds):
644644
msk = df["fold"].isin(folds)
645645
filenames = df["filename"][msk]
646646
targets = df["target"][msk].values
647-
waves = np.array(
648-
[read_wav_file(fil) for fil in filenames], dtype=np.float32
649-
)
647+
waves = np.array([read_wav_file(fil) for fil in filenames], dtype=np.float32)
650648
return waves, targets
651649
```
652650

@@ -1791,7 +1789,7 @@ plt.show()
17911789

17921790

17931791

1794-
![png](https://github.com/mostafa-mahmoud/keras-io/blob/master/examples/audio/img/stft/training.png)
1792+
![png](https://github.com/keras-team/keras-io/blob/master/examples/audio/img/stft/training.png)
17951793

17961794

17971795

@@ -1803,9 +1801,7 @@ Running the models on the test set.
18031801

18041802
```python
18051803
_, test_acc = model1d.evaluate(test_x, test_y)
1806-
print(
1807-
f"1D model wit non-trainable STFT -> Test Accuracy: {test_acc * 100:.2f}%"
1808-
)
1804+
print(f"1D model wit non-trainable STFT -> Test Accuracy: {test_acc * 100:.2f}%")
18091805
```
18101806

18111807
3/3 ━━━━━━━━━━━━━━━━━━━━ 3s 307ms/step - accuracy: 0.8148 - loss: 0.6244

0 commit comments

Comments
 (0)