Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
31510d08
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看板
提交
31510d08
编写于
12月 09, 2021
作者:
G
gongel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: rm kaldi_io
上级
12318566
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
9 deletion
+7
-9
paddlespeech/cli/st/infer.py
paddlespeech/cli/st/infer.py
+7
-8
setup.py
setup.py
+0
-1
未找到文件。
paddlespeech/cli/st/infer.py
浏览文件 @
31510d08
...
@@ -18,11 +18,14 @@ from typing import List
...
@@ -18,11 +18,14 @@ from typing import List
from
typing
import
Optional
from
typing
import
Optional
from
typing
import
Union
from
typing
import
Union
import
kaldi
_
io
import
kaldiio
import
numpy
as
np
import
numpy
as
np
import
paddle
import
paddle
import
soundfile
import
soundfile
from
kaldiio
import
WriteHelper
from
kaldiio
import
WriteHelper
from
paddlespeech.s2t.frontend.featurizer.text_featurizer
import
TextFeaturizer
from
paddlespeech.s2t.utils.dynamic_import
import
dynamic_import
from
paddlespeech.s2t.utils.utility
import
UpdateConfig
from
yacs.config
import
CfgNode
from
yacs.config
import
CfgNode
from
..executor
import
BaseExecutor
from
..executor
import
BaseExecutor
...
@@ -30,9 +33,6 @@ from ..utils import cli_register
...
@@ -30,9 +33,6 @@ from ..utils import cli_register
from
..utils
import
download_and_decompress
from
..utils
import
download_and_decompress
from
..utils
import
logger
from
..utils
import
logger
from
..utils
import
MODEL_HOME
from
..utils
import
MODEL_HOME
from
paddlespeech.s2t.frontend.featurizer.text_featurizer
import
TextFeaturizer
from
paddlespeech.s2t.utils.dynamic_import
import
dynamic_import
from
paddlespeech.s2t.utils.utility
import
UpdateConfig
__all__
=
[
"STExecutor"
]
__all__
=
[
"STExecutor"
]
...
@@ -234,7 +234,7 @@ class STExecutor(BaseExecutor):
...
@@ -234,7 +234,7 @@ class STExecutor(BaseExecutor):
f
"
{
utt_name
}
{
wav_file
}
"
.
encode
(
"utf8"
))
f
"
{
utt_name
}
{
wav_file
}
"
.
encode
(
"utf8"
))
fbank_extract_process
.
stdin
.
close
()
fbank_extract_process
.
stdin
.
close
()
fbank_feat
=
dict
(
fbank_feat
=
dict
(
kaldi
_io
.
read_mat
_ark
(
fbank_extract_process
.
stdout
))[
utt_name
]
kaldi
io
.
load
_ark
(
fbank_extract_process
.
stdout
))[
utt_name
]
extract_command
=
[
"compute-kaldi-pitch-feats"
,
"scp:-"
,
"ark:-"
]
extract_command
=
[
"compute-kaldi-pitch-feats"
,
"scp:-"
,
"ark:-"
]
pitch_extract_process
=
subprocess
.
Popen
(
pitch_extract_process
=
subprocess
.
Popen
(
...
@@ -251,8 +251,7 @@ class STExecutor(BaseExecutor):
...
@@ -251,8 +251,7 @@ class STExecutor(BaseExecutor):
stdout
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
stderr
=
subprocess
.
PIPE
)
pitch_extract_process
.
stdin
.
close
()
pitch_extract_process
.
stdin
.
close
()
pitch_feat
=
dict
(
pitch_feat
=
dict
(
kaldiio
.
load_ark
(
pitch_process
.
stdout
))[
utt_name
]
kaldi_io
.
read_mat_ark
(
pitch_process
.
stdout
))[
utt_name
]
concated_feat
=
np
.
concatenate
((
fbank_feat
,
pitch_feat
),
axis
=
1
)
concated_feat
=
np
.
concatenate
((
fbank_feat
,
pitch_feat
),
axis
=
1
)
raw_feat
=
f
"
{
utt_name
}
.raw"
raw_feat
=
f
"
{
utt_name
}
.raw"
with
WriteHelper
(
with
WriteHelper
(
...
@@ -272,7 +271,7 @@ class STExecutor(BaseExecutor):
...
@@ -272,7 +271,7 @@ class STExecutor(BaseExecutor):
stdin
=
cmvn_process
.
stdout
,
stdin
=
cmvn_process
.
stdout
,
stdout
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
stderr
=
subprocess
.
PIPE
)
norm_feat
=
dict
(
kaldi
_io
.
read_mat
_ark
(
process
.
stdout
))[
utt_name
]
norm_feat
=
dict
(
kaldi
io
.
load
_ark
(
process
.
stdout
))[
utt_name
]
self
.
_inputs
[
"audio"
]
=
paddle
.
to_tensor
(
norm_feat
).
unsqueeze
(
0
)
self
.
_inputs
[
"audio"
]
=
paddle
.
to_tensor
(
norm_feat
).
unsqueeze
(
0
)
self
.
_inputs
[
"audio_len"
]
=
paddle
.
to_tensor
(
self
.
_inputs
[
"audio_len"
]
=
paddle
.
to_tensor
(
self
.
_inputs
[
"audio"
].
shape
[
1
],
dtype
=
"int64"
)
self
.
_inputs
[
"audio"
].
shape
[
1
],
dtype
=
"int64"
)
...
...
setup.py
浏览文件 @
31510d08
...
@@ -37,7 +37,6 @@ requirements = {
...
@@ -37,7 +37,6 @@ requirements = {
"jieba"
,
"jieba"
,
"jsonlines"
,
"jsonlines"
,
"kaldiio"
,
"kaldiio"
,
"kaldi_io"
,
"librosa"
,
"librosa"
,
"loguru"
,
"loguru"
,
"matplotlib"
,
"matplotlib"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录