feat: OpenVINO CPU MetricGAN mask; 100 ms hop
Per-worker OpenVINO CPU runs the MetricGAN BLSTM mask; SpeechBrain keeps STFT/ISTFT. ENHANCE_INFER=auto with torch fallback. Hop is 0.1 s after isolated last_ms ~6 ms (model+ov+beamform).
This commit is contained in:
@@ -94,7 +94,8 @@ def test_process_records_last_dt_ms():
|
||||
def test_stereo_beamform_then_model_preserves_hop():
|
||||
c = AudioCleaner(
|
||||
mode="force", beamform="force", chunk_s=0.5, hop_s=0.25)
|
||||
assert c.backend == "model+beamform"
|
||||
assert "model" in c.backend
|
||||
assert "beamform" in c.backend
|
||||
hop = 4000
|
||||
t = np.arange(hop)
|
||||
ch0 = (np.sin(2 * np.pi * 440 * t / 16000) * 8000).astype(np.int16)
|
||||
@@ -104,3 +105,19 @@ def test_stereo_beamform_then_model_preserves_hop():
|
||||
out = c.process(stereo)
|
||||
assert out.dtype == np.int16
|
||||
assert out.shape == (hop,)
|
||||
|
||||
|
||||
def test_openvino_cpu_infer_loads_and_preserves_hop():
|
||||
c = AudioCleaner(
|
||||
mode="force", beamform="off", enhance_infer="openvino",
|
||||
chunk_s=0.5, hop_s=0.25)
|
||||
assert c.infer_backend == "openvino"
|
||||
assert c._ov_compiled is not None
|
||||
assert "ov" in c.backend
|
||||
hop = 4000
|
||||
pcm = (np.sin(2 * np.pi * 440 * np.arange(hop) / 16000) * 8000).astype(
|
||||
np.int16)
|
||||
for _ in range(4):
|
||||
out = c.process(pcm)
|
||||
assert out.dtype == np.int16
|
||||
assert out.shape == (hop,)
|
||||
|
||||
@@ -13,3 +13,7 @@ def test_default_beamform_mode_auto():
|
||||
|
||||
def test_torch_num_threads_default_one():
|
||||
assert Config().torch_num_threads == 1
|
||||
|
||||
|
||||
def test_enhance_infer_default_auto():
|
||||
assert Config().enhance_infer == "auto"
|
||||
|
||||
Reference in New Issue
Block a user