mirror of
https://github.com/YuzuZensai/spleeter.git
synced 2026-01-06 04:32:43 +00:00
fix tests and more testing
This commit is contained in:
@@ -27,27 +27,27 @@ from spleeter.utils.configuration import load_configuration
|
||||
|
||||
res_4stems = { "vocals": {
|
||||
"SDR": 0.000,
|
||||
"SAR": -15.856,
|
||||
"SIR": -6.861,
|
||||
"SAR": -16.212,
|
||||
"SIR": -4.172,
|
||||
"ISR": 0.000
|
||||
},
|
||||
"drums": {
|
||||
"SDR": -0.069,
|
||||
"SAR": -15.769,
|
||||
"SIR": -5.049,
|
||||
"SDR": -0.077,
|
||||
"SAR": -15.739,
|
||||
"SIR": -5.045,
|
||||
"ISR": 0.001
|
||||
},
|
||||
"bass":{
|
||||
"SDR": -0.000,
|
||||
"SAR": -10.499,
|
||||
"SIR": -6.988,
|
||||
"SAR": -10.665,
|
||||
"SIR": -5.646,
|
||||
"ISR": -0.000
|
||||
},
|
||||
"other":{
|
||||
"SDR": -1.365,
|
||||
"SAR": -14.591,
|
||||
"SIR": -4.751,
|
||||
"ISR": -0.016
|
||||
"SDR": -1.309,
|
||||
"SAR": -14.573,
|
||||
"SIR": -4.705,
|
||||
"ISR": -0.014
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,13 +72,10 @@ def test_separator_backends(test_file):
|
||||
out_lib = separator_lib._separate_librosa(waveform, test_file)
|
||||
|
||||
for instrument in out_lib.keys():
|
||||
# test that both outputs are not null
|
||||
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]))
|
||||
# test that both outputs are close everywhere
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user