diff --git a/audio/examples/panns/audio_tag.py b/audio/examples/panns/audio_tag.py index eea14bba9b005c5674e6f38c89dc3e6d98a56b43..6f08cd1ce3260852391d77095e6ea9d1d1f1e3ad 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 667489dda93f60ae23f53e80eb5aa570a02185b9..056c573f2e369c48ca099de9c08ad9dd07d5159a 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 f41307c8d7eacf0390136a2a94552fead319321d..a99b8980c20ed3a2aa3f1c26fff58cf84c6db7ab 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 f36ae30536b68d0a3db714af4bc7b7148238dba7..1be7b27a369e04e47c7b188fb169b1ed07c0d95d 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 af15e80441224575e91c3af7bdbe3adfe1c0562b..30d141cd0dac5c13ce0203d03d0a47700d9b849d 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 bd10bc9fd4b6fa89dffc4033025703bc771540da..e3b5e2ae039595962e791f21fba327b78b44d57a 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 653e18071b2d825dd6ade676baee0e147270ef60..7556bb3c931b023006ef16791deca92e7b59e806 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 7b764797f5d1a546211f5f5cfca8985b80170407..f53f60f31f59849a253c27a1bc7141e7f5ae05a0 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 a0d5d2dbd195425ff1bdff68864ab64a194f8938..1bf1504e0dc38a85a31c719197d2fd774900f294 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 4d68c1b51fc092df3088446f4bcac266be5887f1..9e4e29cb317cb21c9e224522bafc95ba8b7f301e 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..185a92b8d94d3426d616c0624f0f2ee04339349e 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 906048d72203728387fb18ce424cd089a8fd28a4..d9bb7c1684ff0ac5c1ddfb10127b5bde332faac0 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 3eb0db145c2c849a0c8bb8be08e85c23b95ac627..ddf17afe9f10939acdcbff9c198cb6ae494764ee 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 fe4d1fbdc1520e72988aa2b189343adad8df974b..c73df5427b08fdfd12bbb7e779afd41b058f7780 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 -