refactor: move audio package from utils to top

This commit is contained in:
Félix Voituret
2019-11-08 17:09:17 -05:00
parent 2bdb3aa013
commit c4d1343897
10 changed files with 17 additions and 16 deletions

View File

@@ -51,13 +51,13 @@ setup(
license='MIT License',
packages=[
'spleeter',
'spleeter.audio',
'spleeter.commands',
'spleeter.model',
'spleeter.model.functions',
'spleeter.model.provider',
'spleeter.resources',
'spleeter.utils',
'spleeter.utils.audio',
],
package_data={'spleeter.resources': ['*.json']},
python_requires='>=3.6, <3.8',

View File

@@ -20,8 +20,8 @@ import tensorflow as tf
import numpy as np
# pylint: enable=import-error
from ..utils.audio.adapter import get_audio_adapter
from ..utils.audio.convertor import to_n_channels
from ..audio.adapter import get_audio_adapter
from ..audio.convertor import to_n_channels
from ..utils.estimator import create_estimator
from ..utils.tensor import set_tensor_shape

View File

@@ -13,9 +13,9 @@ from functools import partial
import tensorflow as tf
# pylint: enable=import-error
from ..audio.adapter import get_audio_adapter
from ..dataset import get_training_dataset, get_validation_dataset
from ..model import model_fn
from ..utils.audio.adapter import get_audio_adapter
from ..utils.logging import get_logger
__email__ = 'research@deezer.com'

View File

@@ -2,15 +2,16 @@
# coding: utf8
"""
Module for building data preprocessing pipeline using the tensorflow data
API.
Data preprocessing such as audio loading, spectrogram computation, cropping,
feature caching or data augmentation is done using a tensorflow dataset object
that output a tuple (input_, output) 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)
Module for building data preprocessing pipeline using the tensorflow
data API. Data preprocessing such as audio loading, spectrogram
computation, cropping, feature caching or data augmentation is done
using a tensorflow dataset object that output a tuple (input_, output)
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)
"""
import time
@@ -23,10 +24,10 @@ import numpy as np
import tensorflow as tf
# pylint: enable=import-error
from .utils.audio.convertor import (
from .audio.convertor import (
db_uint_spectrogram_to_gain,
spectrogram_to_db_uint)
from .utils.audio.spectrogram import (
from .audio.spectrogram import (
compute_spectrogram_tf,
random_pitch_shift,
random_time_stretch)

View File

@@ -20,9 +20,9 @@ from multiprocessing import Pool
from pathlib import Path
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 .utils.audio.adapter import get_default_audio_adapter
from .utils.audio.convertor import to_stereo
from .utils.configuration import load_configuration
from .utils.estimator import create_estimator, to_predictor