mirror of
https://github.com/YuzuZensai/spleeter.git
synced 2026-01-31 14:58:23 +00:00
refactor: move audio package from utils to top
This commit is contained in:
2
setup.py
2
setup.py
@@ -51,13 +51,13 @@ setup(
|
|||||||
license='MIT License',
|
license='MIT License',
|
||||||
packages=[
|
packages=[
|
||||||
'spleeter',
|
'spleeter',
|
||||||
|
'spleeter.audio',
|
||||||
'spleeter.commands',
|
'spleeter.commands',
|
||||||
'spleeter.model',
|
'spleeter.model',
|
||||||
'spleeter.model.functions',
|
'spleeter.model.functions',
|
||||||
'spleeter.model.provider',
|
'spleeter.model.provider',
|
||||||
'spleeter.resources',
|
'spleeter.resources',
|
||||||
'spleeter.utils',
|
'spleeter.utils',
|
||||||
'spleeter.utils.audio',
|
|
||||||
],
|
],
|
||||||
package_data={'spleeter.resources': ['*.json']},
|
package_data={'spleeter.resources': ['*.json']},
|
||||||
python_requires='>=3.6, <3.8',
|
python_requires='>=3.6, <3.8',
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ import tensorflow as tf
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
# pylint: enable=import-error
|
# pylint: enable=import-error
|
||||||
|
|
||||||
from ..utils.audio.adapter import get_audio_adapter
|
from ..audio.adapter import get_audio_adapter
|
||||||
from ..utils.audio.convertor import to_n_channels
|
from ..audio.convertor import to_n_channels
|
||||||
from ..utils.estimator import create_estimator
|
from ..utils.estimator import create_estimator
|
||||||
from ..utils.tensor import set_tensor_shape
|
from ..utils.tensor import set_tensor_shape
|
||||||
|
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ from functools import partial
|
|||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
# pylint: enable=import-error
|
# pylint: enable=import-error
|
||||||
|
|
||||||
|
from ..audio.adapter import get_audio_adapter
|
||||||
from ..dataset import get_training_dataset, get_validation_dataset
|
from ..dataset import get_training_dataset, get_validation_dataset
|
||||||
from ..model import model_fn
|
from ..model import model_fn
|
||||||
from ..utils.audio.adapter import get_audio_adapter
|
|
||||||
from ..utils.logging import get_logger
|
from ..utils.logging import get_logger
|
||||||
|
|
||||||
__email__ = 'research@deezer.com'
|
__email__ = 'research@deezer.com'
|
||||||
|
|||||||
@@ -2,15 +2,16 @@
|
|||||||
# coding: utf8
|
# coding: utf8
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Module for building data preprocessing pipeline using the tensorflow data
|
Module for building data preprocessing pipeline using the tensorflow
|
||||||
API.
|
data API. Data preprocessing such as audio loading, spectrogram
|
||||||
Data preprocessing such as audio loading, spectrogram computation, cropping,
|
computation, cropping, feature caching or data augmentation is done
|
||||||
feature caching or data augmentation is done using a tensorflow dataset object
|
using a tensorflow dataset object that output a tuple (input_, output)
|
||||||
that output a tuple (input_, output) where:
|
where:
|
||||||
- input_ is a dictionary with a single key that contains the (batched) mix
|
|
||||||
spectrogram of audio samples
|
|
||||||
- output is a dictionary of spectrogram of the isolated tracks (ground truth)
|
|
||||||
|
|
||||||
|
- input is a dictionary with a single key that contains the (batched)
|
||||||
|
mix spectrogram of audio samples
|
||||||
|
- output is a dictionary of spectrogram of the isolated tracks
|
||||||
|
(ground truth)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import time
|
import time
|
||||||
@@ -23,10 +24,10 @@ import numpy as np
|
|||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
# pylint: enable=import-error
|
# pylint: enable=import-error
|
||||||
|
|
||||||
from .utils.audio.convertor import (
|
from .audio.convertor import (
|
||||||
db_uint_spectrogram_to_gain,
|
db_uint_spectrogram_to_gain,
|
||||||
spectrogram_to_db_uint)
|
spectrogram_to_db_uint)
|
||||||
from .utils.audio.spectrogram import (
|
from .audio.spectrogram import (
|
||||||
compute_spectrogram_tf,
|
compute_spectrogram_tf,
|
||||||
random_pitch_shift,
|
random_pitch_shift,
|
||||||
random_time_stretch)
|
random_time_stretch)
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ from multiprocessing import Pool
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from os.path import join
|
from os.path import join
|
||||||
|
|
||||||
|
from .audio.adapter import get_default_audio_adapter
|
||||||
|
from .audio.convertor import to_stereo
|
||||||
from .model import model_fn
|
from .model import model_fn
|
||||||
from .utils.audio.adapter import get_default_audio_adapter
|
|
||||||
from .utils.audio.convertor import to_stereo
|
|
||||||
from .utils.configuration import load_configuration
|
from .utils.configuration import load_configuration
|
||||||
from .utils.estimator import create_estimator, to_predictor
|
from .utils.estimator import create_estimator, to_predictor
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user