Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
4bcecc1c
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
大约 2 年 前同步成功
通知
210
Star
8425
Fork
1598
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
245
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DeepSpeech
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
245
Issue
245
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4bcecc1c
编写于
7月 01, 2022
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format
上级
ad3b1abf
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
32 addition
and
70 deletion
+32
-70
paddlespeech/__init__.py
paddlespeech/__init__.py
+1
-3
paddlespeech/audio/__init__.py
paddlespeech/audio/__init__.py
+4
-5
paddlespeech/audio/backends/__init__.py
paddlespeech/audio/backends/__init__.py
+3
-2
paddlespeech/audio/backends/soundfile_backend.py
paddlespeech/audio/backends/soundfile_backend.py
+2
-3
paddlespeech/audio/datasets/dataset.py
paddlespeech/audio/datasets/dataset.py
+2
-1
paddlespeech/audio/datasets/rirs_noises.py
paddlespeech/audio/datasets/rirs_noises.py
+2
-1
paddlespeech/audio/utils/__init__.py
paddlespeech/audio/utils/__init__.py
+2
-7
paddlespeech/audio/utils/numeric.py
paddlespeech/audio/utils/numeric.py
+5
-6
setup.py
setup.py
+11
-42
未找到文件。
paddlespeech/__init__.py
浏览文件 @
4bcecc1c
...
@@ -18,6 +18,4 @@ from . import audio
...
@@ -18,6 +18,4 @@ from . import audio
# _init_audio_backend must called after audio import
# _init_audio_backend must called after audio import
audio
.
backends
.
utils
.
_init_audio_backend
()
audio
.
backends
.
utils
.
_init_audio_backend
()
__all__
=
[
__all__
=
[
"audio"
]
"audio"
]
paddlespeech/audio/__init__.py
浏览文件 @
4bcecc1c
...
@@ -11,7 +11,6 @@
...
@@ -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
.
import
compliance
from
.
import
compliance
from
.
import
datasets
from
.
import
datasets
from
.
import
features
from
.
import
features
...
@@ -19,10 +18,10 @@ from . import functional
...
@@ -19,10 +18,10 @@ from . import functional
from
.
import
io
from
.
import
io
from
.
import
metric
from
.
import
metric
from
.
import
utils
from
.
import
utils
from
._ops
import
ops
from
._ops
import
ops
from
paddlespeech.audio.backends
import
get_audio_backend
from
paddlespeech.audio.backends
import
get_audio_backend
,
list_audio_backends
,
set_audio_backend
from
paddlespeech.audio.backends
import
list_audio_backends
from
paddlespeech.audio.backends
import
set_audio_backend
__all__
=
[
__all__
=
[
"io"
,
"io"
,
...
@@ -35,4 +34,4 @@ __all__ = [
...
@@ -35,4 +34,4 @@ __all__ = [
"list_audio_backends"
,
"list_audio_backends"
,
"get_audio_backend"
,
"get_audio_backend"
,
"set_audio_backend"
,
"set_audio_backend"
,
]
]
\ No newline at end of file
paddlespeech/audio/backends/__init__.py
浏览文件 @
4bcecc1c
...
@@ -11,7 +11,8 @@
...
@@ -11,7 +11,8 @@
# 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.
# flake8: noqa
# flake8: noqa
from
.
import
utils
from
.
import
utils
from
.utils
import
get_audio_backend
,
list_audio_backends
,
set_audio_backend
from
.utils
import
get_audio_backend
\ No newline at end of file
from
.utils
import
list_audio_backends
from
.utils
import
set_audio_backend
paddlespeech/audio/backends/soundfile_backend.py
浏览文件 @
4bcecc1c
...
@@ -15,15 +15,14 @@ import os
...
@@ -15,15 +15,14 @@ import os
import
warnings
import
warnings
from
typing
import
Optional
from
typing
import
Optional
from
typing
import
Tuple
from
typing
import
Tuple
from
typing
import
Union
import
numpy
as
np
import
numpy
as
np
import
resampy
import
resampy
import
soundfile
as
sf
import
soundfile
as
sf
from
scipy.io
import
wavfile
from
scipy.io
import
wavfile
from
..utils
import
ParameterError
from
..utils
import
depth_convert
from
..utils
import
depth_convert
from
..utils
import
ParameterError
__all__
=
[
__all__
=
[
'resample'
,
'resample'
,
...
@@ -254,4 +253,4 @@ def load(
...
@@ -254,4 +253,4 @@ def load(
def
info
(
filepath
:
str
)
->
None
:
def
info
(
filepath
:
str
)
->
None
:
raise
RuntimeError
(
"No audio I/O backend is available."
)
raise
RuntimeError
(
"No audio I/O backend is available."
)
\ No newline at end of file
paddlespeech/audio/datasets/dataset.py
浏览文件 @
4bcecc1c
...
@@ -71,7 +71,8 @@ class AudioClassificationDataset(paddle.io.Dataset):
...
@@ -71,7 +71,8 @@ class AudioClassificationDataset(paddle.io.Dataset):
if
self
.
sample_rate
is
None
:
if
self
.
sample_rate
is
None
:
waveform
,
sample_rate
=
paddlespeech
.
audio
.
load
(
file
)
waveform
,
sample_rate
=
paddlespeech
.
audio
.
load
(
file
)
else
:
else
:
waveform
,
sample_rate
=
paddlespeech
.
audio
.
load
(
file
,
sr
=
self
.
sample_rate
)
waveform
,
sample_rate
=
paddlespeech
.
audio
.
load
(
file
,
sr
=
self
.
sample_rate
)
feat_func
=
feat_funcs
[
self
.
feat_type
]
feat_func
=
feat_funcs
[
self
.
feat_type
]
...
...
paddlespeech/audio/datasets/rirs_noises.py
浏览文件 @
4bcecc1c
...
@@ -141,7 +141,8 @@ class OpenRIRNoise(Dataset):
...
@@ -141,7 +141,8 @@ class OpenRIRNoise(Dataset):
end_sample
=
int
(
float
(
e
)
*
sr
)
end_sample
=
int
(
float
(
e
)
*
sr
)
new_wav_file
=
os
.
path
.
join
(
self
.
base_path
,
new_wav_file
=
os
.
path
.
join
(
self
.
base_path
,
audio_id
+
f
'_chunk_
{
idx
+
1
:
02
}
.wav'
)
audio_id
+
f
'_chunk_
{
idx
+
1
:
02
}
.wav'
)
paddlespeech
.
audio
.
save
(
waveform
[
start_sample
:
end_sample
],
sr
,
new_wav_file
)
paddlespeech
.
audio
.
save
(
waveform
[
start_sample
:
end_sample
],
sr
,
new_wav_file
)
# id, duration, new_wav
# id, duration, new_wav
ret
.
append
([
chunk
,
self
.
chunk_duration
,
new_wav_file
])
ret
.
append
([
chunk
,
self
.
chunk_duration
,
new_wav_file
])
else
:
# Keep whole audio.
else
:
# Keep whole audio.
...
...
paddlespeech/audio/utils/__init__.py
浏览文件 @
4bcecc1c
...
@@ -13,18 +13,13 @@
...
@@ -13,18 +13,13 @@
# limitations under the License.
# limitations under the License.
from
...cli.utils
import
DATA_HOME
from
...cli.utils
import
DATA_HOME
from
...cli.utils
import
MODEL_HOME
from
...cli.utils
import
MODEL_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
.error
import
ParameterError
from
.error
import
ParameterError
from
.log
import
Logger
from
.log
import
Logger
from
.log
import
logger
from
.log
import
logger
from
.numeric
import
depth_convert
from
.numeric
import
pcm16to32
from
.time
import
seconds_to_hms
from
.time
import
seconds_to_hms
from
.time
import
Timer
from
.time
import
Timer
from
.numeric
import
pcm16to32
from
.numeric
import
depth_convert
\ No newline at end of file
paddlespeech/audio/utils/numeric.py
浏览文件 @
4bcecc1c
...
@@ -11,13 +11,12 @@
...
@@ -11,13 +11,12 @@
# 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.
import
numpy
as
np
from
typing
import
Union
from
typing
import
Union
__all__
=
[
import
numpy
as
np
"pcm16to32"
,
"depth_convert"
__all__
=
[
"pcm16to32"
,
"depth_convert"
]
]
def
pcm16to32
(
audio
:
np
.
ndarray
)
->
np
.
ndarray
:
def
pcm16to32
(
audio
:
np
.
ndarray
)
->
np
.
ndarray
:
"""pcm int16 to float32
"""pcm int16 to float32
...
@@ -105,4 +104,4 @@ def depth_convert(y: np.ndarray, dtype: Union[type, str]) -> np.ndarray:
...
@@ -105,4 +104,4 @@ def depth_convert(y: np.ndarray, dtype: Union[type, str]) -> np.ndarray:
if
dtype
in
[
'float32'
,
'float64'
]:
if
dtype
in
[
'float32'
,
'float64'
]:
org_dtype
=
y
.
dtype
org_dtype
=
y
.
dtype
y
=
y
.
astype
(
dtype
)
/
np
.
iinfo
(
org_dtype
).
max
y
=
y
.
astype
(
dtype
)
/
np
.
iinfo
(
org_dtype
).
max
return
y
return
y
\ No newline at end of file
setup.py
浏览文件 @
4bcecc1c
...
@@ -27,7 +27,6 @@ from setuptools import Command
...
@@ -27,7 +27,6 @@ from setuptools import Command
from
setuptools
import
find_packages
from
setuptools
import
find_packages
from
setuptools
import
setup
from
setuptools
import
setup
from
setuptools.command.develop
import
develop
from
setuptools.command.develop
import
develop
from
setuptools.command.install
import
install
from
setuptools.command.test
import
test
from
setuptools.command.test
import
test
from
tools
import
setup_helpers
from
tools
import
setup_helpers
...
@@ -38,43 +37,13 @@ VERSION = '0.0.0'
...
@@ -38,43 +37,13 @@ VERSION = '0.0.0'
COMMITID
=
'none'
COMMITID
=
'none'
base
=
[
base
=
[
"editdistance"
,
"editdistance"
,
"g2p_en"
,
"g2pM"
,
"h5py"
,
"inflect"
,
"jieba"
,
"jsonlines"
,
"g2p_en"
,
"kaldiio"
,
"librosa==0.8.1"
,
"loguru"
,
"matplotlib"
,
"nara_wpe"
,
"g2pM"
,
"onnxruntime"
,
"pandas"
,
"paddlenlp"
,
"paddlespeech_feat"
,
"praatio==5.0.0"
,
"h5py"
,
"pypinyin"
,
"pypinyin-dict"
,
"python-dateutil"
,
"pyworld"
,
"resampy==0.2.2"
,
"inflect"
,
"sacrebleu"
,
"scipy"
,
"sentencepiece~=0.1.96"
,
"soundfile~=0.10"
,
"jieba"
,
"textgrid"
,
"timer"
,
"tqdm"
,
"typeguard"
,
"visualdl"
,
"webrtcvad"
,
"jsonlines"
,
"yacs~=0.1.8"
,
"prettytable"
,
"zhon"
,
"colorlog"
,
"pathos == 0.2.8"
"kaldiio"
,
"librosa==0.8.1"
,
"loguru"
,
"matplotlib"
,
"nara_wpe"
,
"onnxruntime"
,
"pandas"
,
"paddlenlp"
,
"paddlespeech_feat"
,
"praatio==5.0.0"
,
"pypinyin"
,
"pypinyin-dict"
,
"python-dateutil"
,
"pyworld"
,
"resampy==0.2.2"
,
"sacrebleu"
,
"scipy"
,
"sentencepiece~=0.1.96"
,
"soundfile~=0.10"
,
"textgrid"
,
"timer"
,
"tqdm"
,
"typeguard"
,
"visualdl"
,
"webrtcvad"
,
"yacs~=0.1.8"
,
"prettytable"
,
"zhon"
,
"colorlog"
,
"pathos == 0.2.8"
]
]
server
=
[
server
=
[
...
@@ -141,7 +110,9 @@ def check_output(cmd: Union[str, List[str], Tuple[str]], shell=False):
...
@@ -141,7 +110,9 @@ def check_output(cmd: Union[str, List[str], Tuple[str]], shell=False):
def
_run_cmd
(
cmd
):
def
_run_cmd
(
cmd
):
try
:
try
:
return
subprocess
.
check_output
(
cmd
,
cwd
=
ROOT_DIR
,
stderr
=
subprocess
.
DEVNULL
).
decode
(
"ascii"
).
strip
()
return
subprocess
.
check_output
(
cmd
,
cwd
=
ROOT_DIR
,
stderr
=
subprocess
.
DEVNULL
).
decode
(
"ascii"
).
strip
()
except
Exception
:
except
Exception
:
return
None
return
None
...
@@ -193,7 +164,6 @@ class DevelopCommand(develop):
...
@@ -193,7 +164,6 @@ class DevelopCommand(develop):
self
.
execute
(
_post_install
,
(
self
.
install_lib
,
),
msg
=
"Post Install..."
)
self
.
execute
(
_post_install
,
(
self
.
install_lib
,
),
msg
=
"Post Install..."
)
class
TestCommand
(
test
):
class
TestCommand
(
test
):
def
finalize_options
(
self
):
def
finalize_options
(
self
):
test
.
finalize_options
(
self
)
test
.
finalize_options
(
self
)
...
@@ -207,7 +177,7 @@ class TestCommand(test):
...
@@ -207,7 +177,7 @@ class TestCommand(test):
# cmd: python setup.py upload
# cmd: python setup.py upload
class
UploadCommand
(
distutils
.
cmd
.
Command
):
class
UploadCommand
(
Command
):
description
=
"Build and publish the package."
description
=
"Build and publish the package."
user_options
=
[]
user_options
=
[]
...
@@ -270,7 +240,6 @@ class clean(distutils.command.clean.clean):
...
@@ -270,7 +240,6 @@ class clean(distutils.command.clean.clean):
def
main
():
def
main
():
sha
=
_run_cmd
([
"git"
,
"rev-parse"
,
"HEAD"
])
# commit id
sha
=
_run_cmd
([
"git"
,
"rev-parse"
,
"HEAD"
])
# commit id
branch
=
_run_cmd
([
"git"
,
"rev-parse"
,
"--abbrev-ref"
,
"HEAD"
])
branch
=
_run_cmd
([
"git"
,
"rev-parse"
,
"--abbrev-ref"
,
"HEAD"
])
tag
=
_run_cmd
([
"git"
,
"describe"
,
"--tags"
,
"--exact-match"
,
"@"
])
tag
=
_run_cmd
([
"git"
,
"describe"
,
"--tags"
,
"--exact-match"
,
"@"
])
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录