Update README.md
Browse files
README.md
CHANGED
@@ -74,11 +74,12 @@ from speechbrain.pretrained import SepformerSeparation as separator
|
|
74 |
from speechbrain.pretrained.interfaces import SNREstimator as snrest
|
75 |
import torchaudio
|
76 |
|
|
|
77 |
model = separator.from_hparams(source="speechbrain/sepformer-whamr", savedir='pretrained_models/sepformer-whamr2')
|
78 |
est_sources = model.separate_file(path='speechbrain/sepformer-wsj02mix/test_mixture.wav')
|
79 |
|
80 |
-
|
81 |
-
|
82 |
mix, fs = torchaudio.load('test_mixture.wav')
|
83 |
snrhat = snr_est_model.estimate_batch(mix, est_sources)
|
84 |
|
|
|
74 |
from speechbrain.pretrained.interfaces import SNREstimator as snrest
|
75 |
import torchaudio
|
76 |
|
77 |
+
# 1- Separate the mixture with a pretrained model (sepformer-whamr in this case)
|
78 |
model = separator.from_hparams(source="speechbrain/sepformer-whamr", savedir='pretrained_models/sepformer-whamr2')
|
79 |
est_sources = model.separate_file(path='speechbrain/sepformer-wsj02mix/test_mixture.wav')
|
80 |
|
81 |
+
# 2- Estimate the performance
|
82 |
+
snr_est_model = snrest.from_hparams(source="speechbrain/REAL-M-sisnr-estimator",savedir='pretrained_models/REAL-M-sisnr-estimator')
|
83 |
mix, fs = torchaudio.load('test_mixture.wav')
|
84 |
snrhat = snr_est_model.estimate_batch(mix, est_sources)
|
85 |
|