Merge pull request #1490 from zh794390558/ut

[audio] tests and metric dir, format code
pull/1518/head
Hui Zhang 4 years ago committed by GitHub
commit bb74c5b555
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,13 @@
# Copyright (c) 2022 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.

@ -0,0 +1,13 @@
# Copyright (c) 2022 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.

@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .librosa import Spectrogram
from .librosa import MelSpectrogram
from .librosa import LogMelSpectrogram from .librosa import LogMelSpectrogram
from .librosa import MelSpectrogram
from .librosa import Spectrogram

@ -0,0 +1,13 @@
# Copyright (c) 2022 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.

@ -23,9 +23,8 @@ from numpy import ndarray as array
from numpy.lib.stride_tricks import as_strided from numpy.lib.stride_tricks import as_strided
from scipy import signal from scipy import signal
from ..utils import ParameterError
from ..backends import depth_convert from ..backends import depth_convert
from ..utils import ParameterError
__all__ = [ __all__ = [
# dsp # dsp

@ -1,6 +1,19 @@
from .audio import save_wav # Copyright (c) 2022 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.
from .audio import depth_convert
from .audio import load from .audio import load
from .audio import normalize from .audio import normalize
from .audio import to_mono
from .audio import resample from .audio import resample
from .audio import depth_convert from .audio import save_wav
from .audio import to_mono

@ -0,0 +1,13 @@
# Copyright (c) 2022 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.

@ -0,0 +1,13 @@
# Copyright (c) 2022 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.

@ -0,0 +1,13 @@
# Copyright (c) 2022 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.

@ -11,20 +11,15 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .env import USER_HOME
from .env import PPAUDIO_HOME
from .env import MODEL_HOME
from .env import DATA_HOME
from .download import decompress from .download import decompress
from .download import download_and_decompress from .download import download_and_decompress
from .download import load_state_dict_from_url from .download import load_state_dict_from_url
from .env import DATA_HOME
from .env import MODEL_HOME
from .env import PPAUDIO_HOME
from .env import USER_HOME
from .error import ParameterError from .error import ParameterError
from .log import logger
from .log import Logger from .log import Logger
from .log import logger
from .time import Timer
from .time import seconds_to_hms from .time import seconds_to_hms
from .time import Timer

@ -28,6 +28,7 @@ __all__ = [
'load_state_dict_from_url', 'load_state_dict_from_url',
] ]
def decompress(file: str): def decompress(file: str):
""" """
Extracts all files from a compressed file. Extracts all files from a compressed file.

@ -23,10 +23,11 @@ import os
__all__ = [ __all__ = [
'USER_HOME', 'USER_HOME',
'PPAUDIO_HOME', 'PPAUDIO_HOME',
'MODEL_HOME' , 'MODEL_HOME',
'DATA_HOME' , 'DATA_HOME',
] ]
def _get_user_home(): def _get_user_home():
return os.path.expanduser('~') return os.path.expanduser('~')

@ -19,6 +19,7 @@ __all__ = [
'seconds_to_hms', 'seconds_to_hms',
] ]
class Timer(object): class Timer(object):
'''Calculate runing speed and estimated time of arrival(ETA)''' '''Calculate runing speed and estimated time of arrival(ETA)'''

Loading…
Cancel
Save