format code

pull/960/head
Hui Zhang 3 years ago
parent bb5f9e7ad7
commit 2a66c2c13b

@ -17,7 +17,6 @@ from typing import List
import numpy as np import numpy as np
import paddle import paddle
from paddleaudio.backends import load as load_audio from paddleaudio.backends import load as load_audio
from paddleaudio.features import melspectrogram from paddleaudio.features import melspectrogram
from paddleaudio.models.panns import cnn14 from paddleaudio.models.panns import cnn14

@ -17,7 +17,6 @@ import os
from typing import Dict from typing import Dict
import numpy as np import numpy as np
from paddleaudio.utils import logger from paddleaudio.utils import logger
# yapf: disable # yapf: disable

@ -16,11 +16,10 @@ import os
import numpy as np import numpy as np
from paddle import inference from paddle import inference
from scipy.special import softmax
from paddleaudio.backends import load as load_audio from paddleaudio.backends import load as load_audio
from paddleaudio.datasets import ESC50 from paddleaudio.datasets import ESC50
from paddleaudio.features import melspectrogram from paddleaudio.features import melspectrogram
from scipy.special import softmax
# yapf: disable # yapf: disable
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()

@ -16,7 +16,6 @@ import os
import paddle import paddle
from model import SoundClassifier from model import SoundClassifier
from paddleaudio.datasets import ESC50 from paddleaudio.datasets import ESC50
from paddleaudio.models.panns import cnn14 from paddleaudio.models.panns import cnn14

@ -17,7 +17,6 @@ import numpy as np
import paddle import paddle
import paddle.nn.functional as F import paddle.nn.functional as F
from model import SoundClassifier from model import SoundClassifier
from paddleaudio.backends import load as load_audio from paddleaudio.backends import load as load_audio
from paddleaudio.datasets import ESC50 from paddleaudio.datasets import ESC50
from paddleaudio.features import melspectrogram from paddleaudio.features import melspectrogram

@ -16,7 +16,6 @@ import os
import paddle import paddle
from model import SoundClassifier from model import SoundClassifier
from paddleaudio.datasets import ESC50 from paddleaudio.datasets import ESC50
from paddleaudio.models.panns import cnn14 from paddleaudio.models.panns import cnn14
from paddleaudio.utils import logger from paddleaudio.utils import logger

@ -15,7 +15,6 @@ from typing import List
import numpy as np import numpy as np
from numpy import ndarray as array from numpy import ndarray as array
from paddleaudio.backends import depth_convert from paddleaudio.backends import depth_convert
from paddleaudio.utils import ParameterError from paddleaudio.utils import ParameterError

@ -20,9 +20,8 @@ import numpy as np
import scipy import scipy
from numpy import ndarray as array from numpy import ndarray as array
from numpy.lib.stride_tricks import as_strided from numpy.lib.stride_tricks import as_strided
from scipy.signal import get_window
from paddleaudio.utils import ParameterError from paddleaudio.utils import ParameterError
from scipy.signal import get_window
__all__ = [ __all__ = [
'stft', 'stft',

@ -13,9 +13,8 @@
# limitations under the License. # limitations under the License.
import librosa import librosa
import numpy as np import numpy as np
import pytest
import paddleaudio import paddleaudio
import pytest
TEST_FILE = './test/data/test_audio.wav' TEST_FILE = './test/data/test_audio.wav'

@ -13,9 +13,8 @@
# limitations under the License. # limitations under the License.
import librosa import librosa
import numpy as np import numpy as np
import pytest
import paddleaudio as pa import paddleaudio as pa
import pytest
@pytest.mark.filterwarnings("ignore::DeprecationWarning") @pytest.mark.filterwarnings("ignore::DeprecationWarning")

@ -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.

@ -45,7 +45,8 @@ import_alias = dict(
istft="paddlespeech.s2t.transform.spectrogram:IStft", istft="paddlespeech.s2t.transform.spectrogram:IStft",
stft2fbank="paddlespeech.s2t.transform.spectrogram:Stft2LogMelSpectrogram", stft2fbank="paddlespeech.s2t.transform.spectrogram:Stft2LogMelSpectrogram",
wpe="paddlespeech.s2t.transform.wpe:WPE", wpe="paddlespeech.s2t.transform.wpe:WPE",
channel_selector="paddlespeech.s2t.transform.channel_selector:ChannelSelector", ) channel_selector="paddlespeech.s2t.transform.channel_selector:ChannelSelector",
)
class Transformation(): class Transformation():

@ -35,7 +35,8 @@ def dynamic_import(import_path, alias=dict()):
:return: imported class :return: imported class
""" """
if import_path not in alias and ":" not in import_path: if import_path not in alias and ":" not in import_path:
raise ValueError("import_path should be one of {} or " raise ValueError(
"import_path should be one of {} or "
'include ":", e.g. "paddlespeech.s2t.models.u2:U2Model" : ' 'include ":", e.g. "paddlespeech.s2t.models.u2:U2Model" : '
"{}".format(set(alias), import_path)) "{}".format(set(alias), import_path))
if ":" not in import_path: if ":" not in import_path:

@ -25,4 +25,3 @@ licence: None
* [nnAudio](https://github.com/KinWaiCheuk/nnAudio.git) * [nnAudio](https://github.com/KinWaiCheuk/nnAudio.git)
licence: MIT licence: MIT

Loading…
Cancel
Save