Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
6b1fe701
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看板
提交
6b1fe701
编写于
2月 24, 2022
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format code,test=doc
上级
0a5624fe
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
36 addition
and
37 deletion
+36
-37
.pre-commit-config.yaml
.pre-commit-config.yaml
+2
-1
dataset/voxceleb/voxceleb1.py
dataset/voxceleb/voxceleb1.py
+4
-0
examples/ami/sd0/local/ami_prepare.py
examples/ami/sd0/local/ami_prepare.py
+6
-8
examples/voxceleb/sv0/local/make_voxceleb_kaldi_trial.py
examples/voxceleb/sv0/local/make_voxceleb_kaldi_trial.py
+18
-13
paddlespeech/__init__.py
paddlespeech/__init__.py
+0
-11
paddlespeech/cli/asr/infer.py
paddlespeech/cli/asr/infer.py
+2
-1
paddlespeech/s2t/io/utility.py
paddlespeech/s2t/io/utility.py
+1
-1
paddlespeech/t2s/datasets/dataset.py
paddlespeech/t2s/datasets/dataset.py
+1
-1
utils/DER.py
utils/DER.py
+2
-1
未找到文件。
.pre-commit-config.yaml
浏览文件 @
6b1fe701
...
...
@@ -50,12 +50,13 @@ repos:
entry
:
bash .pre-commit-hooks/clang-format.hook -i
language
:
system
files
:
\.(c|cc|cxx|cpp|cu|h|hpp|hxx|cuh|proto)$
exclude
:
(?=speechx/speechx/kaldi).*(\.cpp|\.cc|\.h|\.py)$
-
id
:
copyright_checker
name
:
copyright_checker
entry
:
python .pre-commit-hooks/copyright-check.hook
language
:
system
files
:
\.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|py)$
exclude
:
(?=third_party|pypinyin
).*(\.cpp
|\.h|\.py)$
exclude
:
(?=third_party|pypinyin
|speechx/speechx/kaldi).*(\.cpp|\.cc
|\.h|\.py)$
-
repo
:
https://github.com/asottile/reorder_python_imports
rev
:
v2.4.0
hooks
:
...
...
dataset/voxceleb/voxceleb1.py
浏览文件 @
6b1fe701
...
...
@@ -80,6 +80,7 @@ parser.add_argument(
args
=
parser
.
parse_args
()
def
create_manifest
(
data_dir
,
manifest_path_prefix
):
print
(
"Creating manifest %s ..."
%
manifest_path_prefix
)
json_lines
=
[]
...
...
@@ -128,6 +129,7 @@ def create_manifest(data_dir, manifest_path_prefix):
print
(
f
"
{
total_text
/
total_sec
}
text/sec"
,
file
=
f
)
print
(
f
"
{
total_sec
/
total_num
}
sec/utt"
,
file
=
f
)
def
prepare_dataset
(
base_url
,
data_list
,
target_dir
,
manifest_path
,
target_data
):
if
not
os
.
path
.
exists
(
target_dir
):
...
...
@@ -164,6 +166,7 @@ def prepare_dataset(base_url, data_list, target_dir, manifest_path,
# create the manifest file
create_manifest
(
data_dir
=
target_dir
,
manifest_path_prefix
=
manifest_path
)
def
main
():
if
args
.
target_dir
.
startswith
(
'~'
):
args
.
target_dir
=
os
.
path
.
expanduser
(
args
.
target_dir
)
...
...
@@ -184,5 +187,6 @@ def main():
print
(
"Manifest prepare done!"
)
if
__name__
==
'__main__'
:
main
()
examples/ami/sd0/local/ami_prepare.py
浏览文件 @
6b1fe701
...
...
@@ -22,19 +22,17 @@ Authors
* qingenz123@126.com (Qingen ZHAO) 2022
"""
import
os
import
logging
import
argparse
import
xml.etree.ElementTree
as
et
import
glob
import
json
from
ami_splits
import
get_AMI_split
import
logging
import
os
import
xml.etree.ElementTree
as
et
from
distutils.util
import
strtobool
from
dataio
import
(
load_pkl
,
save_pkl
,
)
from
ami_splits
import
get_AMI_split
from
dataio
import
load_pkl
from
dataio
import
save_pkl
logger
=
logging
.
getLogger
(
__name__
)
SAMPLERATE
=
16000
...
...
examples/voxceleb/sv0/local/make_voxceleb_kaldi_trial.py
浏览文件 @
6b1fe701
...
...
@@ -12,28 +12,30 @@
# 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.
"""
Make VoxCeleb1 trial of kaldi format
this script creat the test trial from kaldi trial voxceleb1_test_v2.txt or official trial veri_test2.txt
to kaldi trial format
"""
import
argparse
import
codecs
import
os
parser
=
argparse
.
ArgumentParser
(
description
=
__doc__
)
parser
.
add_argument
(
"--voxceleb_trial"
,
parser
.
add_argument
(
"--voxceleb_trial"
,
default
=
"voxceleb1_test_v2"
,
type
=
str
,
help
=
"VoxCeleb trial file. Default we use the kaldi trial voxceleb1_test_v2.txt"
)
parser
.
add_argument
(
"--trial"
,
help
=
"VoxCeleb trial file. Default we use the kaldi trial voxceleb1_test_v2.txt"
)
parser
.
add_argument
(
"--trial"
,
default
=
"data/test/trial"
,
type
=
str
,
help
=
"Kaldi format trial file"
)
args
=
parser
.
parse_args
()
def
main
(
voxceleb_trial
,
trial
):
"""
VoxCeleb provide several trial file, which format is different with kaldi format.
...
...
@@ -58,7 +60,9 @@ def main(voxceleb_trial, trial):
"""
print
(
"Start convert the voxceleb trial to kaldi format"
)
if
not
os
.
path
.
exists
(
voxceleb_trial
):
raise
RuntimeError
(
"{} does not exist. Pleas input the correct file path"
.
format
(
voxceleb_trial
))
raise
RuntimeError
(
"{} does not exist. Pleas input the correct file path"
.
format
(
voxceleb_trial
))
trial_dirname
=
os
.
path
.
dirname
(
trial
)
if
not
os
.
path
.
exists
(
trial_dirname
):
...
...
@@ -77,5 +81,6 @@ def main(voxceleb_trial, trial):
w
.
write
(
"{} {} {}
\n
"
.
format
(
utt_id1
,
utt_id2
,
target
))
print
(
"Convert the voxceleb trial to kaldi format successfully"
)
if
__name__
==
"__main__"
:
main
(
args
.
voxceleb_trial
,
args
.
trial
)
paddlespeech/__init__.py
浏览文件 @
6b1fe701
...
...
@@ -11,14 +11,3 @@
# 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.
paddlespeech/cli/asr/infer.py
浏览文件 @
6b1fe701
...
...
@@ -413,7 +413,8 @@ class ASRExecutor(BaseExecutor):
def
_check
(
self
,
audio_file
:
str
,
sample_rate
:
int
,
force_yes
:
bool
):
self
.
sample_rate
=
sample_rate
if
self
.
sample_rate
!=
16000
and
self
.
sample_rate
!=
8000
:
logger
.
error
(
"invalid sample rate, please input --sr 8000 or --sr 16000"
)
logger
.
error
(
"invalid sample rate, please input --sr 8000 or --sr 16000"
)
return
False
if
isinstance
(
audio_file
,
(
str
,
os
.
PathLike
)):
...
...
paddlespeech/s2t/io/utility.py
浏览文件 @
6b1fe701
...
...
@@ -11,8 +11,8 @@
# 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
typing
import
List
from
io
import
BytesIO
from
typing
import
List
import
numpy
as
np
...
...
paddlespeech/t2s/datasets/dataset.py
浏览文件 @
6b1fe701
utils/DER.py
浏览文件 @
6b1fe701
...
...
@@ -23,10 +23,11 @@ Credits
This code is adapted from https://github.com/nryant/dscore
"""
import
argparse
from
distutils.util
import
strtobool
import
os
import
re
import
subprocess
from
distutils.util
import
strtobool
import
numpy
as
np
FILE_IDS
=
re
.
compile
(
r
"(?<=Speaker Diarization for).+(?=\*\*\*)"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录