test: lock speechbrain lengths and identity camera filter
Filter --cameras 1,5 by cam-NN identity instead of discovery index.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import inspect
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
from audio_cleanup import AudioCleaner
|
||||
|
||||
|
||||
def test_enhance_batch_without_lengths_typeerror():
|
||||
c = AudioCleaner(mode="force")
|
||||
assert c.backend == "model"
|
||||
import torch
|
||||
|
||||
w = torch.zeros(1, 8000)
|
||||
with pytest.raises(TypeError):
|
||||
c._enhancer.enhance_batch(w)
|
||||
|
||||
|
||||
def test_process_uses_relative_lengths_one():
|
||||
src = inspect.getsource(AudioCleaner.process)
|
||||
assert "tensor([1.0])" in src
|
||||
|
||||
|
||||
def test_process_preserves_length_and_int16():
|
||||
c = AudioCleaner(mode="force")
|
||||
n = 16000
|
||||
pcm = (np.sin(2 * np.pi * 440 * np.arange(n) / 16000) * 8000).astype(np.int16)
|
||||
out = c.process(pcm)
|
||||
assert out.dtype == np.int16
|
||||
assert out.shape == pcm.shape
|
||||
Reference in New Issue
Block a user