mirror of
https://github.com/YuzuZensai/spleeter.git
synced 2026-01-31 14:58:23 +00:00
fix tests and more testing
This commit is contained in:
@@ -106,5 +106,7 @@ def test_evaluate(path="FAKE_MUSDB_DIR"):
|
|||||||
params = load_configuration(arguments.configuration)
|
params = load_configuration(arguments.configuration)
|
||||||
metrics = evaluate.entrypoint(arguments, params)
|
metrics = evaluate.entrypoint(arguments, params)
|
||||||
for instrument, metric in metrics.items():
|
for instrument, metric in metrics.items():
|
||||||
|
print(instrument), print(metric)
|
||||||
for m, value in metric.items():
|
for m, value in metric.items():
|
||||||
assert np.allclose(np.median(value), res_4stems[instrument][m], atol=1e-3)
|
print(np.median(value)), print(res_4stems[instrument][m])
|
||||||
|
assert np.allclose(np.median(value), res_4stems[instrument][m], atol=1e-3)
|
||||||
|
|||||||
@@ -72,13 +72,10 @@ def test_separator_backends(test_file):
|
|||||||
out_lib = separator_lib._separate_librosa(waveform, test_file)
|
out_lib = separator_lib._separate_librosa(waveform, test_file)
|
||||||
|
|
||||||
for instrument in out_lib.keys():
|
for instrument in out_lib.keys():
|
||||||
# test that both outputs are not null
|
# test that both outputs are close everywhere
|
||||||
print(np.sum(np.abs(out_tf[instrument])))
|
|
||||||
print(np.sum(np.abs(out_lib[instrument])))
|
|
||||||
assert np.sum(np.abs(out_tf[instrument])) > 1000
|
|
||||||
assert np.sum(np.abs(out_lib[instrument])) > 1000
|
|
||||||
print(np.max(out_tf[instrument]- out_lib[instrument]))
|
|
||||||
assert np.allclose(out_tf[instrument], out_lib[instrument], atol=0.025)
|
assert np.allclose(out_tf[instrument], out_lib[instrument], atol=0.025)
|
||||||
|
# it should be even more similar outside edges zones
|
||||||
|
assert np.allclose(out_tf[instrument][4096:-4096,:], out_lib[instrument][4096:-4096,:], atol=0.002)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('test_file, configuration, backend', TEST_CONFIGURATIONS)
|
@pytest.mark.parametrize('test_file, configuration, backend', TEST_CONFIGURATIONS)
|
||||||
|
|||||||
Reference in New Issue
Block a user