Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
aaf39863
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看板
提交
aaf39863
编写于
10月 25, 2022
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more info
上级
4dbff16f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
7 deletion
+14
-7
speechx/speechx/decoder/ctc_prefix_beam_search_decoder.cc
speechx/speechx/decoder/ctc_prefix_beam_search_decoder.cc
+1
-1
speechx/speechx/recognizer/u2_recognizer_main.cc
speechx/speechx/recognizer/u2_recognizer_main.cc
+13
-6
未找到文件。
speechx/speechx/decoder/ctc_prefix_beam_search_decoder.cc
浏览文件 @
aaf39863
...
...
@@ -74,7 +74,7 @@ void CTCPrefixBeamSearch::AdvanceDecode(
std
::
vector
<
kaldi
::
BaseFloat
>
frame_prob
;
bool
flag
=
decodable
->
FrameLikelihood
(
num_frame_decoded_
,
&
frame_prob
);
if
(
flag
==
false
)
{
LOG
(
INFO
)
<<
"decoder advance decode exit."
<<
frame_prob
.
size
();
VLOG
(
1
)
<<
"decoder advance decode exit."
<<
frame_prob
.
size
();
break
;
}
...
...
speechx/speechx/recognizer/u2_recognizer_main.cc
浏览文件 @
aaf39863
...
...
@@ -49,11 +49,13 @@ int main(int argc, char* argv[]) {
kaldi
::
Timer
timer
;
for
(;
!
wav_reader
.
Done
();
wav_reader
.
Next
())
{
kaldi
::
Timer
local_timer
;
std
::
string
utt
=
wav_reader
.
Key
();
const
kaldi
::
WaveData
&
wave_data
=
wav_reader
.
Value
();
LOG
(
INFO
)
<<
"utt: "
<<
utt
;
LOG
(
INFO
)
<<
"wav dur: "
<<
wave_data
.
Duration
()
<<
" sec."
;
tot_wav_duration
+=
wave_data
.
Duration
();
double
dur
=
wave_data
.
Duration
();
tot_wav_duration
+=
dur
;
int32
this_channel
=
0
;
kaldi
::
SubVector
<
kaldi
::
BaseFloat
>
waveform
(
wave_data
.
Data
(),
...
...
@@ -63,6 +65,7 @@ int main(int argc, char* argv[]) {
int
sample_offset
=
0
;
int
cnt
=
0
;
while
(
sample_offset
<
tot_samples
)
{
int
cur_chunk_size
=
std
::
min
(
chunk_sample_size
,
tot_samples
-
sample_offset
);
...
...
@@ -78,8 +81,10 @@ int main(int argc, char* argv[]) {
recognizer
.
SetFinished
();
}
recognizer
.
Decode
();
LOG
(
INFO
)
<<
"Pratial result: "
<<
cnt
<<
" "
<<
recognizer
.
GetPartialResult
();
if
(
recognizer
.
DecodedSomething
())
{
LOG
(
INFO
)
<<
"Pratial result: "
<<
cnt
<<
" "
<<
recognizer
.
GetPartialResult
();
}
// no overlap
sample_offset
+=
cur_chunk_size
;
...
...
@@ -101,7 +106,9 @@ int main(int argc, char* argv[]) {
continue
;
}
LOG
(
INFO
)
<<
" the result of "
<<
utt
<<
" is "
<<
result
;
LOG
(
INFO
)
<<
utt
<<
" "
<<
result
;
LOG
(
INFO
)
<<
" RTF: "
<<
dur
/
local_timer
.
Elapsed
()
<<
" dur: "
<<
dur
<<
" cost: "
<<
local_timer
.
Elapsed
();
result_writer
.
Write
(
utt
,
result
);
...
...
@@ -111,7 +118,7 @@ int main(int argc, char* argv[]) {
double
elapsed
=
timer
.
Elapsed
();
LOG
(
INFO
)
<<
"Done "
<<
num_done
<<
" out of "
<<
(
num_err
+
num_done
);
LOG
(
INFO
)
<<
"cost:"
<<
elapsed
<<
" sec"
;
LOG
(
INFO
)
<<
"
total
cost:"
<<
elapsed
<<
" sec"
;
LOG
(
INFO
)
<<
"total wav duration is: "
<<
tot_wav_duration
<<
" sec"
;
LOG
(
INFO
)
<<
"
the
RTF is: "
<<
elapsed
/
tot_wav_duration
;
LOG
(
INFO
)
<<
"RTF is: "
<<
elapsed
/
tot_wav_duration
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录