Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusted the images URLs and minor linting comments in markdown examples #1958

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions examples/audio/md/stft.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)



Expand All @@ -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)



Expand All @@ -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)



Expand All @@ -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
```

Expand Down Expand Up @@ -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)



Expand All @@ -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
Expand Down
18 changes: 7 additions & 11 deletions templates/examples/audio/stft.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
**Description:** Introducing the `STFTSpectrogram` layer to extract spectrograms for audio classification.


<div class='example_version_banner keras_3'>ⓘ This example uses Keras 3</div>
<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)


Expand Down Expand Up @@ -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)
```

Expand Down Expand Up @@ -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)



Expand All @@ -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)



Expand All @@ -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)



Expand All @@ -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
```

Expand Down Expand Up @@ -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)



Expand All @@ -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
Expand Down
Loading