Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
81207201
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看板
提交
81207201
编写于
10月 15, 2017
作者:
X
Xinghai Sun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix a bug in running tools/compute_meanstd.py with seqbin data.
上级
9ac15f8b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
20 deletion
+5
-20
data_utils/audio.py
data_utils/audio.py
+5
-2
data_utils/data.py
data_utils/data.py
+0
-4
data_utils/speech.py
data_utils/speech.py
+0
-14
未找到文件。
data_utils/audio.py
浏览文件 @
81207201
...
@@ -65,8 +65,11 @@ class AudioSegment(object):
...
@@ -65,8 +65,11 @@ class AudioSegment(object):
:return: Audio segment instance.
:return: Audio segment instance.
:rtype: AudioSegment
:rtype: AudioSegment
"""
"""
samples
,
sample_rate
=
soundfile
.
read
(
file
,
dtype
=
'float32'
)
if
isinstance
(
file
,
basestring
)
and
re
.
findall
(
r
".seqbin_\d+$"
,
file
):
return
cls
(
samples
,
sample_rate
)
return
cls
.
from_sequence_file
(
file
)
else
:
samples
,
sample_rate
=
soundfile
.
read
(
file
,
dtype
=
'float32'
)
return
cls
(
samples
,
sample_rate
)
@
classmethod
@
classmethod
def
slice_from_file
(
cls
,
file
,
start
=
None
,
end
=
None
):
def
slice_from_file
(
cls
,
file
,
start
=
None
,
end
=
None
):
...
...
data_utils/data.py
浏览文件 @
81207201
...
@@ -7,7 +7,6 @@ from __future__ import print_function
...
@@ -7,7 +7,6 @@ from __future__ import print_function
import
random
import
random
import
tarfile
import
tarfile
import
re
import
multiprocessing
import
multiprocessing
import
numpy
as
np
import
numpy
as
np
import
paddle.v2
as
paddle
import
paddle.v2
as
paddle
...
@@ -105,9 +104,6 @@ class DataGenerator(object):
...
@@ -105,9 +104,6 @@ class DataGenerator(object):
if
filename
.
startswith
(
'tar:'
):
if
filename
.
startswith
(
'tar:'
):
speech_segment
=
SpeechSegment
.
from_file
(
speech_segment
=
SpeechSegment
.
from_file
(
self
.
_subfile_from_tar
(
filename
),
transcript
)
self
.
_subfile_from_tar
(
filename
),
transcript
)
elif
re
.
findall
(
r
".seqbin_\d+$"
,
filename
):
speech_segment
=
SpeechSegment
.
from_sequence_file
(
filename
,
transcript
)
else
:
else
:
speech_segment
=
SpeechSegment
.
from_file
(
filename
,
transcript
)
speech_segment
=
SpeechSegment
.
from_file
(
filename
,
transcript
)
self
.
_augmentation_pipeline
.
transform_audio
(
speech_segment
)
self
.
_augmentation_pipeline
.
transform_audio
(
speech_segment
)
...
...
data_utils/speech.py
浏览文件 @
81207201
...
@@ -50,20 +50,6 @@ class SpeechSegment(AudioSegment):
...
@@ -50,20 +50,6 @@ class SpeechSegment(AudioSegment):
audio
=
AudioSegment
.
from_file
(
filepath
)
audio
=
AudioSegment
.
from_file
(
filepath
)
return
cls
(
audio
.
samples
,
audio
.
sample_rate
,
transcript
)
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
@
classmethod
def
from_bytes
(
cls
,
bytes
,
transcript
):
def
from_bytes
(
cls
,
bytes
,
transcript
):
"""Create speech segment from a byte string and corresponding
"""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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录