Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
f17347f4
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看板
提交
f17347f4
编写于
3月 31, 2022
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
glog to stderr
上级
aa0cb236
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
20 addition
and
6 deletion
+20
-6
demos/audio_searching/src/encode.py
demos/audio_searching/src/encode.py
+0
-4
speechx/examples/CMakeLists.txt
speechx/examples/CMakeLists.txt
+2
-0
speechx/examples/README.md
speechx/examples/README.md
+2
-1
speechx/examples/decoder/offline_decoder_main.cc
speechx/examples/decoder/offline_decoder_main.cc
+1
-0
speechx/examples/decoder/run.sh
speechx/examples/decoder/run.sh
+4
-1
speechx/examples/feat/linear_spectrogram_main.cc
speechx/examples/feat/linear_spectrogram_main.cc
+10
-0
speechx/examples/feat/run.sh
speechx/examples/feat/run.sh
+1
-0
未找到文件。
demos/audio_searching/src/encode.py
浏览文件 @
f17347f4
...
...
@@ -11,11 +11,7 @@
# 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.
import
os
import
librosa
import
numpy
as
np
from
config
import
DEFAULT_TABLE
from
logs
import
LOGGER
from
paddlespeech.cli
import
VectorExecutor
...
...
speechx/examples/CMakeLists.txt
浏览文件 @
f17347f4
...
...
@@ -3,3 +3,5 @@ cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
add_subdirectory
(
feat
)
add_subdirectory
(
nnet
)
add_subdirectory
(
decoder
)
add_subdirectory
(
glog
)
\ No newline at end of file
speechx/examples/README.md
浏览文件 @
f17347f4
# Examples
*
decoder - online decoder to work as offlin
e
*
glog - glog usag
e
*
feat - mfcc, linear
*
nnet - ds2 nn
*
decoder - online decoder to work as offline
## How to run
...
...
speechx/examples/decoder/offline_decoder_main.cc
浏览文件 @
f17347f4
...
...
@@ -63,6 +63,7 @@ int main(int argc, char* argv[]) {
int32
chunk_size
=
35
;
decoder
.
InitDecoder
();
LOG
(
INFO
)
<<
"chunk size: "
<<
chunk_size
;
for
(;
!
feature_reader
.
Done
();
feature_reader
.
Next
())
{
string
utt
=
feature_reader
.
Key
();
...
...
speechx/examples/decoder/run.sh
浏览文件 @
f17347f4
...
...
@@ -25,6 +25,9 @@ model_dir=../paddle_asr_model
feat_wspecifier
=
./feats.ark
cmvn
=
./cmvn.ark
export
GLOG_logtostderr
=
1
# 3. run feat
linear_spectrogram_main
\
--wav_rspecifier
=
scp:
$model_dir
/wav.scp
\
...
...
@@ -37,4 +40,4 @@ offline_decoder_main \
--model_path
=
$model_dir
/avg_1.jit.pdmodel
\
--param_path
=
$model_dir
/avg_1.jit.pdparams
\
--dict_file
=
$model_dir
/vocab.txt
\
--lm_path
=
$model_dir
/avg_1.jit.klm
\ No newline at end of file
--lm_path
=
$model_dir
/avg_1.jit.klm
speechx/examples/feat/linear_spectrogram_main.cc
浏览文件 @
f17347f4
...
...
@@ -25,6 +25,8 @@
#include "kaldi/util/kaldi-io.h"
#include "kaldi/util/table-types.h"
#include <glog/logging.h>
DEFINE_string
(
wav_rspecifier
,
""
,
"test wav scp path"
);
DEFINE_string
(
feature_wspecifier
,
""
,
"output feats wspecifier"
);
DEFINE_string
(
cmvn_write_path
,
"./cmvn.ark"
,
"write cmvn"
);
...
...
@@ -172,6 +174,9 @@ int main(int argc, char* argv[]) {
ppspeech
::
LinearSpectrogramOptions
opt
;
opt
.
frame_opts
.
frame_length_ms
=
20
;
opt
.
frame_opts
.
frame_shift_ms
=
10
;
LOG
(
INFO
)
<<
"frame length (ms):"
<<
opt
.
frame_opts
.
frame_length_ms
;
LOG
(
INFO
)
<<
"frame shift (ms):"
<<
opt
.
frame_opts
.
frame_shift_ms
;
ppspeech
::
DecibelNormalizerOptions
db_norm_opt
;
std
::
unique_ptr
<
ppspeech
::
FeatureExtractorInterface
>
base_feature_extractor
(
new
ppspeech
::
DecibelNormalizer
(
db_norm_opt
,
std
::
move
(
data_source
)));
...
...
@@ -190,6 +195,11 @@ int main(int argc, char* argv[]) {
int
sample_rate
=
16000
;
int
chunk_sample_size
=
streaming_chunk
*
sample_rate
;
LOG
(
INFO
)
<<
"sr:"
<<
sample_rate
;
LOG
(
INFO
)
<<
"chunk size (s):"
<<
streaming_chunk
;
LOG
(
INFO
)
<<
"chunk size (sample):"
<<
chunk_sample_size
;
for
(;
!
wav_reader
.
Done
();
wav_reader
.
Next
())
{
std
::
string
utt
=
wav_reader
.
Key
();
const
kaldi
::
WaveData
&
wave_data
=
wav_reader
.
Value
();
...
...
speechx/examples/feat/run.sh
浏览文件 @
f17347f4
...
...
@@ -25,6 +25,7 @@ feat_wspecifier=./feats.ark
cmvn
=
./cmvn.ark
# 3. run feat
export
GLOG_logtostderr
=
1
linear_spectrogram_main
\
--wav_rspecifier
=
scp:
$model_dir
/wav.scp
\
--feature_wspecifier
=
ark,t:
$feat_wspecifier
\
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录