Skip to content

Commit ce4b921

Browse files
Remove call to mir_eval in demucs_tutorial (#4001)
Co-authored-by: Sam Anklesaria <[email protected]>
1 parent 79e9642 commit ce4b921

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

examples/tutorials/hybrid_demucs_tutorial.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,8 @@
4848
import matplotlib.pyplot as plt
4949

5050
######################################################################
51-
# In addition to ``torchaudio``, ``mir_eval`` is required to perform
52-
# signal-to-distortion ratio (SDR) calculations. To install ``mir_eval``
53-
# please use ``pip3 install mir_eval``.
54-
#
5551

5652
from IPython.display import Audio
57-
from mir_eval import separation
5853
from torchaudio.pipelines import HDEMUCS_HIGH_MUSDB_PLUS
5954
from torchaudio.utils import download_asset
6055

@@ -247,10 +242,8 @@ def plot_spectrogram(stft, title="Spectrogram"):
247242

248243

249244
def output_results(original_source: torch.Tensor, predicted_source: torch.Tensor, source: str):
250-
print(
251-
"SDR score is:",
252-
separation.bss_eval_sources(original_source.detach().numpy(), predicted_source.detach().numpy())[0].mean(),
253-
)
245+
# If you have installed the mir_eval package, you can calculate the SDR score with
246+
# `mir_eval.separation.bss_eval_sources(original_source.detach().numpy(), predicted_source.detach().numpy())[0].mean()`
254247
plot_spectrogram(stft(predicted_source)[0], f"Spectrogram - {source}")
255248
return Audio(predicted_source, rate=sample_rate)
256249

0 commit comments

Comments
 (0)