mirror of
https://github.com/YuzuZensai/spleeter.git
synced 2026-01-31 14:58:23 +00:00
@@ -70,13 +70,14 @@ def _separate_evaluation_dataset(arguments, musdb_root_directory, params):
|
|||||||
configuration=arguments.configuration,
|
configuration=arguments.configuration,
|
||||||
inputs=mixtures,
|
inputs=mixtures,
|
||||||
output_path=join(audio_output_directory, _SPLIT),
|
output_path=join(audio_output_directory, _SPLIT),
|
||||||
filename_format='{filename}/{instrument}.{codec}',
|
filename_format='{foldername}/{instrument}.{codec}',
|
||||||
codec='wav',
|
codec='wav',
|
||||||
duration=600.,
|
duration=600.,
|
||||||
offset=0.,
|
offset=0.,
|
||||||
bitrate='128k',
|
bitrate='128k',
|
||||||
MWF=arguments.MWF,
|
MWF=arguments.MWF,
|
||||||
verbose=arguments.verbose),
|
verbose=arguments.verbose,
|
||||||
|
stft_backend="auto"),
|
||||||
params)
|
params)
|
||||||
return audio_output_directory
|
return audio_output_directory
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import logging
|
|||||||
|
|
||||||
from time import time
|
from time import time
|
||||||
from multiprocessing import Pool
|
from multiprocessing import Pool
|
||||||
from os.path import basename, join, splitext
|
from os.path import basename, join, splitext, dirname
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from librosa.core import stft, istft
|
from librosa.core import stft, istft
|
||||||
@@ -204,7 +204,7 @@ class Separator(object):
|
|||||||
given audio adapter.
|
given audio adapter.
|
||||||
|
|
||||||
Filename format should be a Python formattable string that could use
|
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
|
:param audio_descriptor: Describe song to separate, used by audio
|
||||||
adapter to retrieve and load audio data,
|
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]
|
filename = splitext(basename(audio_descriptor))[0]
|
||||||
generated = []
|
generated = []
|
||||||
for instrument, data in sources.items():
|
for instrument, data in sources.items():
|
||||||
path = join(destination, filename_format.format(
|
path = join(destination, filename_format.format(
|
||||||
filename=filename,
|
filename=filename,
|
||||||
instrument=instrument,
|
instrument=instrument,
|
||||||
codec=codec))
|
foldername=foldername,
|
||||||
|
codec=codec,
|
||||||
|
))
|
||||||
directory = os.path.dirname(path)
|
directory = os.path.dirname(path)
|
||||||
if not os.path.exists(directory):
|
if not os.path.exists(directory):
|
||||||
os.makedirs(directory)
|
os.makedirs(directory)
|
||||||
|
|||||||
Reference in New Issue
Block a user