diff --git a/audio/examples/panns/audio_tag.py b/audio/examples/panns/audio_tag.py index eea14bba..6f08cd1c 100644 --- a/audio/examples/panns/audio_tag.py +++ b/audio/examples/panns/audio_tag.py @@ -17,7 +17,6 @@ from typing import List import numpy as np import paddle - from paddleaudio.backends import load as load_audio from paddleaudio.features import melspectrogram from paddleaudio.models.panns import cnn14 diff --git a/audio/examples/panns/parse_result.py b/audio/examples/panns/parse_result.py index 667489dd..056c573f 100644 --- a/audio/examples/panns/parse_result.py +++ b/audio/examples/panns/parse_result.py @@ -17,7 +17,6 @@ import os from typing import Dict import numpy as np - from paddleaudio.utils import logger # yapf: disable diff --git a/audio/examples/sound_classification/deploy/python/predict.py b/audio/examples/sound_classification/deploy/python/predict.py index f41307c8..a99b8980 100644 --- a/audio/examples/sound_classification/deploy/python/predict.py +++ b/audio/examples/sound_classification/deploy/python/predict.py @@ -16,11 +16,10 @@ import os import numpy as np from paddle import inference -from scipy.special import softmax - from paddleaudio.backends import load as load_audio from paddleaudio.datasets import ESC50 from paddleaudio.features import melspectrogram +from scipy.special import softmax # yapf: disable parser = argparse.ArgumentParser() diff --git a/audio/examples/sound_classification/export_model.py b/audio/examples/sound_classification/export_model.py index f36ae305..1be7b27a 100644 --- a/audio/examples/sound_classification/export_model.py +++ b/audio/examples/sound_classification/export_model.py @@ -16,7 +16,6 @@ import os import paddle from model import SoundClassifier - from paddleaudio.datasets import ESC50 from paddleaudio.models.panns import cnn14 diff --git a/audio/examples/sound_classification/predict.py b/audio/examples/sound_classification/predict.py index af15e804..30d141cd 100644 --- a/audio/examples/sound_classification/predict.py +++ b/audio/examples/sound_classification/predict.py @@ -17,7 +17,6 @@ import numpy as np import paddle import paddle.nn.functional as F from model import SoundClassifier - from paddleaudio.backends import load as load_audio from paddleaudio.datasets import ESC50 from paddleaudio.features import melspectrogram diff --git a/audio/examples/sound_classification/train.py b/audio/examples/sound_classification/train.py index bd10bc9f..e3b5e2ae 100644 --- a/audio/examples/sound_classification/train.py +++ b/audio/examples/sound_classification/train.py @@ -16,7 +16,6 @@ import os import paddle from model import SoundClassifier - from paddleaudio.datasets import ESC50 from paddleaudio.models.panns import cnn14 from paddleaudio.utils import logger diff --git a/audio/paddleaudio/features/augment.py b/audio/paddleaudio/features/augment.py index 653e1807..7556bb3c 100644 --- a/audio/paddleaudio/features/augment.py +++ b/audio/paddleaudio/features/augment.py @@ -15,7 +15,6 @@ from typing import List import numpy as np from numpy import ndarray as array - from paddleaudio.backends import depth_convert from paddleaudio.utils import ParameterError diff --git a/audio/paddleaudio/features/core.py b/audio/paddleaudio/features/core.py index 7b764797..f53f60f3 100644 --- a/audio/paddleaudio/features/core.py +++ b/audio/paddleaudio/features/core.py @@ -20,9 +20,8 @@ import numpy as np import scipy from numpy import ndarray as array from numpy.lib.stride_tricks import as_strided -from scipy.signal import get_window - from paddleaudio.utils import ParameterError +from scipy.signal import get_window __all__ = [ 'stft', diff --git a/audio/test/unit_test/test_backend.py b/audio/test/unit_test/test_backend.py index a0d5d2db..1bf1504e 100644 --- a/audio/test/unit_test/test_backend.py +++ b/audio/test/unit_test/test_backend.py @@ -13,9 +13,8 @@ # limitations under the License. import librosa import numpy as np -import pytest - import paddleaudio +import pytest TEST_FILE = './test/data/test_audio.wav' diff --git a/audio/test/unit_test/test_features.py b/audio/test/unit_test/test_features.py index 4d68c1b5..9e4e29cb 100644 --- a/audio/test/unit_test/test_features.py +++ b/audio/test/unit_test/test_features.py @@ -13,9 +13,8 @@ # limitations under the License. import librosa import numpy as np -import pytest - import paddleaudio as pa +import pytest @pytest.mark.filterwarnings("ignore::DeprecationWarning") diff --git a/paddlespeech/__init__.py b/paddlespeech/__init__.py index e69de29b..185a92b8 100644 --- a/paddlespeech/__init__.py +++ b/paddlespeech/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/paddlespeech/s2t/transform/transformation.py b/paddlespeech/s2t/transform/transformation.py index 906048d7..d9bb7c16 100644 --- a/paddlespeech/s2t/transform/transformation.py +++ b/paddlespeech/s2t/transform/transformation.py @@ -45,7 +45,8 @@ import_alias = dict( istft="paddlespeech.s2t.transform.spectrogram:IStft", stft2fbank="paddlespeech.s2t.transform.spectrogram:Stft2LogMelSpectrogram", wpe="paddlespeech.s2t.transform.wpe:WPE", - channel_selector="paddlespeech.s2t.transform.channel_selector:ChannelSelector", ) + channel_selector="paddlespeech.s2t.transform.channel_selector:ChannelSelector", +) class Transformation(): diff --git a/paddlespeech/s2t/utils/dynamic_import.py b/paddlespeech/s2t/utils/dynamic_import.py index 3eb0db14..ddf17afe 100644 --- a/paddlespeech/s2t/utils/dynamic_import.py +++ b/paddlespeech/s2t/utils/dynamic_import.py @@ -35,9 +35,10 @@ def dynamic_import(import_path, alias=dict()): :return: imported class """ if import_path not in alias and ":" not in import_path: - raise ValueError("import_path should be one of {} or " - 'include ":", e.g. "paddlespeech.s2t.models.u2:U2Model" : ' - "{}".format(set(alias), import_path)) + raise ValueError( + "import_path should be one of {} or " + 'include ":", e.g. "paddlespeech.s2t.models.u2:U2Model" : ' + "{}".format(set(alias), import_path)) if ":" not in import_path: import_path = alias[import_path] diff --git a/third_party/README.md b/third_party/README.md index fe4d1fbd..c73df542 100644 --- a/third_party/README.md +++ b/third_party/README.md @@ -25,4 +25,3 @@ licence: None * [nnAudio](https://github.com/KinWaiCheuk/nnAudio.git) licence: MIT -