Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
9c6735f9
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看板
提交
9c6735f9
编写于
3月 21, 2022
作者:
X
xiongxinlei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add vector voxceleb12 base mode url, test=doc
上级
d28ccfa9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
10 deletion
+23
-10
paddlespeech/cli/vector/infer.py
paddlespeech/cli/vector/infer.py
+23
-10
未找到文件。
paddlespeech/cli/vector/infer.py
浏览文件 @
9c6735f9
...
...
@@ -42,19 +42,19 @@ from paddlespeech.s2t.utils.utility import UpdateConfig
from
paddlespeech.vector.modules.sid_model
import
SpeakerIdetification
pretrained_models
=
{
# The tags for pretrained_models should be "{model_name}[
_{dataset}][-{lang
}][-...]".
# e.g. "
conformer_wenetspeech-zh-16k" and "panns_cnn6-32
k".
# Command line and python api use "{model_name}[
_
{dataset}]" as --model, usage:
# "paddlespeech
asr --model conformer_wenetspeech --lang zh
--sr 16000 --input ./input.wav"
"ecapa_tdnn-16k"
:
{
# The tags for pretrained_models should be "{model_name}[
-{dataset}][-{sr
}][-...]".
# e.g. "
ecapa_tdnn-voxceleb12-16
k".
# Command line and python api use "{model_name}[
-
{dataset}]" as --model, usage:
# "paddlespeech
vector --task spk --model ecapa_tdnn-voxceleb12-16k
--sr 16000 --input ./input.wav"
"ecapa_tdnn-
voxceleb12-
16k"
:
{
'url'
:
'https://paddlespeech.bj.bcebos.com/
s2t/wenetspeech/asr1_conformer_wenetspeech_ckpt_0.1.1.model
.tar.gz'
,
'https://paddlespeech.bj.bcebos.com/
vector/voxceleb/sv0_ecapa_tdnn_voxceleb12_ckpt_0_1_0
.tar.gz'
,
'md5'
:
'
76cb19ed857e6623856b7cd7ebbfeda4
'
,
'
85ff08ce0ef406b8c6d7b5ffc5b2b48f
'
,
'cfg_path'
:
'model.yaml'
,
'
conf/
model.yaml'
,
'ckpt_path'
:
'
exp/conformer/checkpoints/wenetspeech
'
,
'
model/model
'
,
},
}
...
...
@@ -202,6 +202,14 @@ class VectorExecutor(BaseExecutor):
The support models includes
\n\t\t
{}'
.
format
(
tag
,
"
\n\t\t
"
.
join
(
support_models
))
res_path
=
os
.
path
.
join
(
MODEL_HOME
,
tag
)
decompressed_path
=
download_and_decompress
(
pretrained_models
[
tag
],
res_path
)
decompressed_path
=
os
.
path
.
abspath
(
decompressed_path
)
logger
.
info
(
'Use pretrained model stored in: {}'
.
format
(
decompressed_path
))
return
decompressed_path
def
_init_from_path
(
self
,
model_type
:
str
=
'ecapa_tdnn-voxceleb12'
,
...
...
@@ -216,7 +224,12 @@ class VectorExecutor(BaseExecutor):
if
cfg_path
is
None
or
ckpt_path
is
None
:
sample_rate_str
=
"16k"
if
sample_rate
==
16000
else
"8k"
tag
=
model_type
+
"-"
+
sample_rate_str
logger
.
info
(
f
"load the pretrained model:
{
tag
}
"
)
res_path
=
self
.
_get_pretrained_path
(
tag
)
self
.
res_path
=
res_path
self
.
cfg_path
=
os
.
path
.
join
(
res_path
,
pretrained_models
[
tag
][
'cfg_path'
])
self
.
ckpt_path
=
os
.
path
.
join
(
res_path
,
pretrained_models
[
tag
][
'ckpt_path'
]
+
'.pdparams'
)
else
:
self
.
cfg_path
=
os
.
path
.
abspath
(
cfg_path
)
self
.
ckpt_path
=
os
.
path
.
abspath
(
ckpt_path
+
".pdparams"
)
...
...
@@ -226,7 +239,7 @@ class VectorExecutor(BaseExecutor):
logger
.
info
(
f
"start to read the ckpt from
{
self
.
ckpt_path
}
"
)
logger
.
info
(
f
"read the config from
{
self
.
cfg_path
}
"
)
logger
.
info
(
f
"get the res path
{
self
.
res_path
}
"
)
# stage 2: read and config and init the model body
self
.
config
=
CfgNode
(
new_allowed
=
True
)
self
.
config
.
merge_from_file
(
self
.
cfg_path
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录