Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
340e6229
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
1 年多 前同步成功
通知
207
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看板
提交
340e6229
编写于
6月 23, 2021
作者:
H
Haoxin Ma
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix runtime and server
上级
c753b9dd
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
11 addition
and
13 deletion
+11
-13
deepspeech/exps/deepspeech2/bin/deploy/runtime.py
deepspeech/exps/deepspeech2/bin/deploy/runtime.py
+5
-6
deepspeech/exps/deepspeech2/bin/deploy/server.py
deepspeech/exps/deepspeech2/bin/deploy/server.py
+4
-5
deepspeech/io/collator.py
deepspeech/io/collator.py
+1
-1
deepspeech/utils/socket_server.py
deepspeech/utils/socket_server.py
+1
-1
未找到文件。
deepspeech/exps/deepspeech2/bin/deploy/runtime.py
浏览文件 @
340e6229
...
...
@@ -18,8 +18,10 @@ import numpy as np
import
paddle
from
paddle.inference
import
Config
from
paddle.inference
import
create_predictor
from
paddle.io
import
DataLoader
from
deepspeech.exps.deepspeech2.config
import
get_cfg_defaults
from
deepspeech.io.collator
import
SpeechCollator
from
deepspeech.io.dataset
import
ManifestDataset
from
deepspeech.models.deepspeech2
import
DeepSpeech2Model
from
deepspeech.training.cli
import
default_argument_parser
...
...
@@ -29,9 +31,6 @@ from deepspeech.utils.socket_server import warm_up_test
from
deepspeech.utils.utility
import
add_arguments
from
deepspeech.utils.utility
import
print_arguments
from
paddle.io
import
DataLoader
from
deepspeech.io.collator
import
SpeechCollator
def
init_predictor
(
args
):
if
args
.
model_dir
is
not
None
:
...
...
@@ -83,11 +82,11 @@ def start_server(config, args):
config
.
defrost
()
config
.
data
.
manifest
=
config
.
data
.
test_manifest
dataset
=
ManifestDataset
.
from_config
(
config
)
config
.
collator
.
augmentation_config
=
""
config
.
collator
.
keep_transcription_text
=
True
config
.
collator
.
batch_size
=
1
config
.
collator
.
num_workers
=
0
config
.
collator
.
batch_size
=
1
config
.
collator
.
num_workers
=
0
collate_fn
=
SpeechCollator
.
from_config
(
config
)
test_loader
=
DataLoader
(
dataset
,
collate_fn
=
collate_fn
,
num_workers
=
0
)
...
...
deepspeech/exps/deepspeech2/bin/deploy/server.py
浏览文件 @
340e6229
...
...
@@ -16,8 +16,10 @@ import functools
import
numpy
as
np
import
paddle
from
paddle.io
import
DataLoader
from
deepspeech.exps.deepspeech2.config
import
get_cfg_defaults
from
deepspeech.io.collator
import
SpeechCollator
from
deepspeech.io.dataset
import
ManifestDataset
from
deepspeech.models.deepspeech2
import
DeepSpeech2Model
from
deepspeech.training.cli
import
default_argument_parser
...
...
@@ -28,9 +30,6 @@ from deepspeech.utils.utility import add_arguments
from
deepspeech.utils.utility
import
print_arguments
from
paddle.io
import
DataLoader
from
deepspeech.io.collator
import
SpeechCollator
def
start_server
(
config
,
args
):
"""Start the ASR server"""
config
.
defrost
()
...
...
@@ -39,8 +38,8 @@ def start_server(config, args):
config
.
collator
.
augmentation_config
=
""
config
.
collator
.
keep_transcription_text
=
True
config
.
collator
.
batch_size
=
1
config
.
collator
.
num_workers
=
0
config
.
collator
.
batch_size
=
1
config
.
collator
.
num_workers
=
0
collate_fn
=
SpeechCollator
.
from_config
(
config
)
test_loader
=
DataLoader
(
dataset
,
collate_fn
=
collate_fn
,
num_workers
=
0
)
...
...
deepspeech/io/collator.py
浏览文件 @
340e6229
...
...
@@ -242,7 +242,7 @@ class SpeechCollator():
# specgram augment
specgram
=
self
.
_augmentation_pipeline
.
transform_feature
(
specgram
)
specgram
=
specgram
.
transpose
([
1
,
0
])
specgram
=
specgram
.
transpose
([
1
,
0
])
return
specgram
,
transcript_part
def
__call__
(
self
,
batch
):
...
...
deepspeech/utils/socket_server.py
浏览文件 @
340e6229
...
...
@@ -48,7 +48,7 @@ def warm_up_test(audio_process_handler,
rng
=
random
.
Random
(
random_seed
)
samples
=
rng
.
sample
(
manifest
,
num_test_cases
)
for
idx
,
sample
in
enumerate
(
samples
):
print
(
"Warm-up Test Case %d: %s"
%
(
idx
,
sample
[
'feat'
]))
print
(
"Warm-up Test Case %d: %s"
%
(
idx
,
sample
[
'feat'
]))
start_time
=
time
.
time
()
transcript
=
audio_process_handler
(
sample
[
'feat'
])
finish_time
=
time
.
time
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录