Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoussallam committed Jul 24, 2020
1 parent bba1341 commit f98f16e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/test_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ def generate_fake_eval_dataset(path):
aa.save(filename, data, fs)


def test_evaluate(path="FAKE_MUSDB_DIR"):
generate_fake_eval_dataset(path)
p = create_argument_parser()
arguments = p.parse_args(["evaluate", "-p", "spleeter:4stems", "--mus_dir", path])
params = load_configuration(arguments.configuration)
metrics = evaluate.entrypoint(arguments, params)
for instrument, metric in metrics.items():
print(instrument), print(metric)
for m, value in metric.items():
print(np.median(value)), print(res_4stems[instrument][m])
assert np.allclose(np.median(value), res_4stems[instrument][m], atol=1e-3)
@pytest.mark.parametrize('backend', TEST_CONFIGURATIONS)
def test_evaluate(backend):
with TemporaryDirectory() as directory:
generate_fake_eval_dataset(directory)
p = create_argument_parser()
arguments = p.parse_args(["evaluate", "-p", "spleeter:4stems", "--mus_dir", directory, "-B", backend])
params = load_configuration(arguments.configuration)
metrics = evaluate.entrypoint(arguments, params)
for instrument, metric in metrics.items():
for m, value in metric.items():
assert np.allclose(np.median(value), res_4stems[backend][instrument][m], atol=1e-3)

0 comments on commit f98f16e

Please sign in to comment.