Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
b9eafddd
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看板
提交
b9eafddd
编写于
3月 21, 2022
作者:
X
xiongxinlei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change - to _ to distinguish field
上级
9c6735f9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
9 addition
and
9 deletion
+9
-9
paddlespeech/cli/vector/infer.py
paddlespeech/cli/vector/infer.py
+9
-9
未找到文件。
paddlespeech/cli/vector/infer.py
浏览文件 @
b9eafddd
...
@@ -43,10 +43,10 @@ from paddlespeech.vector.modules.sid_model import SpeakerIdetification
...
@@ -43,10 +43,10 @@ from paddlespeech.vector.modules.sid_model import SpeakerIdetification
pretrained_models
=
{
pretrained_models
=
{
# The tags for pretrained_models should be "{model_name}[-{dataset}][-{sr}][-...]".
# The tags for pretrained_models should be "{model_name}[-{dataset}][-{sr}][-...]".
# e.g. "
ecapa_tdnn-
voxceleb12-16k".
# e.g. "
EcapaTdnn_
voxceleb12-16k".
# Command line and python api use "{model_name}[-{dataset}]" as --model, usage:
# 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"
# "paddlespeech vector --task spk --model
EcapaTdnn_voxceleb12
-voxceleb12-16k --sr 16000 --input ./input.wav"
"
ecapa_tdnn-
voxceleb12-16k"
:
{
"
EcapaTdnn_
voxceleb12-16k"
:
{
'url'
:
'url'
:
'https://paddlespeech.bj.bcebos.com/vector/voxceleb/sv0_ecapa_tdnn_voxceleb12_ckpt_0_1_0.tar.gz'
,
'https://paddlespeech.bj.bcebos.com/vector/voxceleb/sv0_ecapa_tdnn_voxceleb12_ckpt_0_1_0.tar.gz'
,
'md5'
:
'md5'
:
...
@@ -59,7 +59,7 @@ pretrained_models = {
...
@@ -59,7 +59,7 @@ pretrained_models = {
}
}
model_alias
=
{
model_alias
=
{
"
ecapa_t
dnn"
:
"paddlespeech.vector.models.ecapa_tdnn:EcapaTdnn"
,
"
EcapaT
dnn"
:
"paddlespeech.vector.models.ecapa_tdnn:EcapaTdnn"
,
}
}
...
@@ -75,8 +75,8 @@ class VectorExecutor(BaseExecutor):
...
@@ -75,8 +75,8 @@ class VectorExecutor(BaseExecutor):
self
.
parser
.
add_argument
(
self
.
parser
.
add_argument
(
"--model"
,
"--model"
,
type
=
str
,
type
=
str
,
default
=
"
ecapa_tdnn-
voxceleb12"
,
default
=
"
EcapaTdnn_
voxceleb12"
,
choices
=
[
"
ecapa_tdnn
"
],
choices
=
[
"
EcapaTdnn_voxceleb12
"
],
help
=
"Choose model type of asr task."
)
help
=
"Choose model type of asr task."
)
self
.
parser
.
add_argument
(
self
.
parser
.
add_argument
(
"--task"
,
"--task"
,
...
@@ -175,7 +175,7 @@ class VectorExecutor(BaseExecutor):
...
@@ -175,7 +175,7 @@ class VectorExecutor(BaseExecutor):
@
stats_wrapper
@
stats_wrapper
def
__call__
(
self
,
def
__call__
(
self
,
audio_file
:
os
.
PathLike
,
audio_file
:
os
.
PathLike
,
model
:
str
=
'
ecapa_t
dnn-voxceleb12'
,
model
:
str
=
'
EcapaT
dnn-voxceleb12'
,
sample_rate
:
int
=
16000
,
sample_rate
:
int
=
16000
,
config
:
os
.
PathLike
=
None
,
config
:
os
.
PathLike
=
None
,
ckpt_path
:
os
.
PathLike
=
None
,
ckpt_path
:
os
.
PathLike
=
None
,
...
@@ -212,7 +212,7 @@ class VectorExecutor(BaseExecutor):
...
@@ -212,7 +212,7 @@ class VectorExecutor(BaseExecutor):
return
decompressed_path
return
decompressed_path
def
_init_from_path
(
self
,
def
_init_from_path
(
self
,
model_type
:
str
=
'
ecapa_tdnn-
voxceleb12'
,
model_type
:
str
=
'
EcapaTdnn_
voxceleb12'
,
sample_rate
:
int
=
16000
,
sample_rate
:
int
=
16000
,
cfg_path
:
Optional
[
os
.
PathLike
]
=
None
,
cfg_path
:
Optional
[
os
.
PathLike
]
=
None
,
ckpt_path
:
Optional
[
os
.
PathLike
]
=
None
):
ckpt_path
:
Optional
[
os
.
PathLike
]
=
None
):
...
@@ -247,7 +247,7 @@ class VectorExecutor(BaseExecutor):
...
@@ -247,7 +247,7 @@ class VectorExecutor(BaseExecutor):
# stage 3: get the model name to instance the model network with dynamic_import
# stage 3: get the model name to instance the model network with dynamic_import
# Noet: we use the '-' to get the model name instead of '_'
# Noet: we use the '-' to get the model name instead of '_'
logger
.
info
(
"start to dynamic import the model class"
)
logger
.
info
(
"start to dynamic import the model class"
)
model_name
=
model_type
[:
model_type
.
rindex
(
'
-
'
)]
model_name
=
model_type
[:
model_type
.
rindex
(
'
_
'
)]
logger
.
info
(
f
"model name
{
model_name
}
"
)
logger
.
info
(
f
"model name
{
model_name
}
"
)
model_class
=
dynamic_import
(
model_name
,
model_alias
)
model_class
=
dynamic_import
(
model_name
,
model_alias
)
model_conf
=
self
.
config
.
model
model_conf
=
self
.
config
.
model
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录