Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
43cdb261
M
models
项目概览
PaddlePaddle
/
models
大约 1 年 前同步成功
通知
222
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
43cdb261
编写于
10月 15, 2017
作者:
X
Xinghai Sun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix a bug in running tools/compute_meanstd.py with seqbin data.
上级
67fcaa27
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
20 deletion
+5
-20
deep_speech_2/data_utils/audio.py
deep_speech_2/data_utils/audio.py
+5
-2
deep_speech_2/data_utils/data.py
deep_speech_2/data_utils/data.py
+0
-4
deep_speech_2/data_utils/speech.py
deep_speech_2/data_utils/speech.py
+0
-14
未找到文件。
deep_speech_2/data_utils/audio.py
浏览文件 @
43cdb261
...
...
@@ -65,8 +65,11 @@ class AudioSegment(object):
:return: Audio segment instance.
:rtype: AudioSegment
"""
samples
,
sample_rate
=
soundfile
.
read
(
file
,
dtype
=
'float32'
)
return
cls
(
samples
,
sample_rate
)
if
isinstance
(
file
,
basestring
)
and
re
.
findall
(
r
".seqbin_\d+$"
,
file
):
return
cls
.
from_sequence_file
(
file
)
else
:
samples
,
sample_rate
=
soundfile
.
read
(
file
,
dtype
=
'float32'
)
return
cls
(
samples
,
sample_rate
)
@
classmethod
def
slice_from_file
(
cls
,
file
,
start
=
None
,
end
=
None
):
...
...
deep_speech_2/data_utils/data.py
浏览文件 @
43cdb261
...
...
@@ -7,7 +7,6 @@ from __future__ import print_function
import
random
import
tarfile
import
re
import
multiprocessing
import
numpy
as
np
import
paddle.v2
as
paddle
...
...
@@ -105,9 +104,6 @@ class DataGenerator(object):
if
filename
.
startswith
(
'tar:'
):
speech_segment
=
SpeechSegment
.
from_file
(
self
.
_subfile_from_tar
(
filename
),
transcript
)
elif
re
.
findall
(
r
".seqbin_\d+$"
,
filename
):
speech_segment
=
SpeechSegment
.
from_sequence_file
(
filename
,
transcript
)
else
:
speech_segment
=
SpeechSegment
.
from_file
(
filename
,
transcript
)
self
.
_augmentation_pipeline
.
transform_audio
(
speech_segment
)
...
...
deep_speech_2/data_utils/speech.py
浏览文件 @
43cdb261
...
...
@@ -50,20 +50,6 @@ class SpeechSegment(AudioSegment):
audio
=
AudioSegment
.
from_file
(
filepath
)
return
cls
(
audio
.
samples
,
audio
.
sample_rate
,
transcript
)
@
classmethod
def
from_sequence_file
(
cls
,
filepath
,
transcript
):
"""Create speech segment from sequence file and transcript.
:param filepath: Filepath of sequence file.
:type filepath: basestring
:param transcript: Transcript text for the speech.
:type transript: basestring
:return: Speech segment instance.
:rtype: SpeechSegment
"""
audio
=
AudioSegment
.
from_sequence_file
(
filepath
)
return
cls
(
audio
.
samples
,
audio
.
sample_rate
,
transcript
)
@
classmethod
def
from_bytes
(
cls
,
bytes
,
transcript
):
"""Create speech segment from a byte string and corresponding
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录