mirror of
https://github.com/YuzuZensai/spleeter.git
synced 2026-01-06 04:32:43 +00:00
Added an extra 'foldername' option in name formatting and use this option to fix eval
This commit is contained in:
@@ -70,7 +70,7 @@ def _separate_evaluation_dataset(arguments, musdb_root_directory, params):
|
||||
configuration=arguments.configuration,
|
||||
inputs=mixtures,
|
||||
output_path=join(audio_output_directory, _SPLIT),
|
||||
filename_format='{filename}/{instrument}.{codec}',
|
||||
filename_format='{foldername}/{instrument}.{codec}',
|
||||
codec='wav',
|
||||
duration=600.,
|
||||
offset=0.,
|
||||
|
||||
@@ -17,7 +17,7 @@ import logging
|
||||
|
||||
from time import time
|
||||
from multiprocessing import Pool
|
||||
from os.path import basename, join, splitext
|
||||
from os.path import basename, join, splitext, dirname
|
||||
import numpy as np
|
||||
import tensorflow as tf
|
||||
from librosa.core import stft, istft
|
||||
@@ -204,7 +204,7 @@ class Separator(object):
|
||||
given audio adapter.
|
||||
|
||||
Filename format should be a Python formattable string that could use
|
||||
following parameters : {instrument}, {filename} and {codec}.
|
||||
following parameters : {instrument}, {filename}, {foldername} and {codec}.
|
||||
|
||||
:param audio_descriptor: Describe song to separate, used by audio
|
||||
adapter to retrieve and load audio data,
|
||||
@@ -255,14 +255,16 @@ class Separator(object):
|
||||
|
||||
"""
|
||||
|
||||
|
||||
foldername = basename(dirname(audio_descriptor))
|
||||
filename = splitext(basename(audio_descriptor))[0]
|
||||
generated = []
|
||||
for instrument, data in sources.items():
|
||||
path = join(destination, filename_format.format(
|
||||
filename=filename,
|
||||
instrument=instrument,
|
||||
codec=codec))
|
||||
foldername=foldername,
|
||||
codec=codec,
|
||||
))
|
||||
directory = os.path.dirname(path)
|
||||
if not os.path.exists(directory):
|
||||
os.makedirs(directory)
|
||||
|
||||
Reference in New Issue
Block a user