mirror of
https://github.com/YuzuZensai/spleeter.git
synced 2026-01-31 04:32:53 +00:00
🐛 fix evaluation test
This commit is contained in:
@@ -189,15 +189,18 @@ def evaluate(
|
|||||||
mixtures = [join(song, EVALUATION_MIXTURE) for song in songs]
|
mixtures = [join(song, EVALUATION_MIXTURE) for song in songs]
|
||||||
audio_output_directory = join(output_path, EVALUATION_AUDIO_DIRECTORY)
|
audio_output_directory = join(output_path, EVALUATION_AUDIO_DIRECTORY)
|
||||||
separate(
|
separate(
|
||||||
adapter=adapter,
|
|
||||||
params_filename=params_filename,
|
|
||||||
files=mixtures,
|
files=mixtures,
|
||||||
output_path=output_path,
|
adapter=adapter,
|
||||||
filename_format='{foldername}/{instrument}.{codec}',
|
bitrate='128k',
|
||||||
codec=Codec.WAV,
|
codec=Codec.WAV,
|
||||||
|
duration=600.,
|
||||||
|
offset=0,
|
||||||
|
output_path=output_path,
|
||||||
|
stft_backend=stft_backend,
|
||||||
|
filename_format='{foldername}/{instrument}.{codec}',
|
||||||
|
params_filename=params_filename,
|
||||||
mwf=mwf,
|
mwf=mwf,
|
||||||
verbose=verbose,
|
verbose=verbose,)
|
||||||
stft_backend=stft_backend)
|
|
||||||
# Compute metrics with musdb.
|
# Compute metrics with musdb.
|
||||||
metrics_output_directory = join(output_path, EVALUATION_METRICS_DIRECTORY)
|
metrics_output_directory = join(output_path, EVALUATION_METRICS_DIRECTORY)
|
||||||
logger.info('Starting musdb evaluation (this could be long) ...')
|
logger.info('Starting musdb evaluation (this could be long) ...')
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ AudioInputArgument: ArgumentInfo = Argument(
|
|||||||
resolve_path=True)
|
resolve_path=True)
|
||||||
|
|
||||||
AudioAdapterOption: OptionInfo = Option(
|
AudioAdapterOption: OptionInfo = Option(
|
||||||
'spleeter.audio.ffmpeg.FFMPEGProcessAudioAdapter',
|
'spleeter.audio.adapter.ffmpeg.FFMPEGProcessAudioAdapter',
|
||||||
'--adapter',
|
'--adapter',
|
||||||
'-a',
|
'-a',
|
||||||
help='Name of the audio adapter to use for audio I/O')
|
help='Name of the audio adapter to use for audio I/O')
|
||||||
|
|||||||
@@ -72,10 +72,13 @@ def test_evaluate(backend):
|
|||||||
with TemporaryDirectory() as directory:
|
with TemporaryDirectory() as directory:
|
||||||
generate_fake_eval_dataset(directory)
|
generate_fake_eval_dataset(directory)
|
||||||
metrics = evaluate(
|
metrics = evaluate(
|
||||||
|
adapter='spleeter.audio.adapter.ffmpeg.FFMPEGProcessAudioAdapter',
|
||||||
|
output_path='eval',
|
||||||
stft_backend=backend,
|
stft_backend=backend,
|
||||||
params_filename='spleeter:4stems',
|
params_filename='spleeter:4stems',
|
||||||
mus_dir=directory,
|
mus_dir=directory,
|
||||||
)
|
mwf=False,
|
||||||
|
verbose=False)
|
||||||
for instrument, metric in metrics.items():
|
for instrument, metric in metrics.items():
|
||||||
for m, value in metric.items():
|
for m, value in metric.items():
|
||||||
assert np.allclose(
|
assert np.allclose(
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ def test_train():
|
|||||||
'-p', 'useless_config.json',
|
'-p', 'useless_config.json',
|
||||||
'-d', path
|
'-d', path
|
||||||
])
|
])
|
||||||
raise IOError(result.stdout)
|
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
# assert that model checkpoint was created.
|
# assert that model checkpoint was created.
|
||||||
assert os.path.exists(join(path, 'model', 'model.ckpt-10.index'))
|
assert os.path.exists(join(path, 'model', 'model.ckpt-10.index'))
|
||||||
|
|||||||
Reference in New Issue
Block a user