Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
9a71c091
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9a71c091
编写于
11月 08, 2021
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove debug info and format code
上级
8b0e344c
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
26 addition
and
32 deletion
+26
-32
examples/librispeech/s1/conf/preprocess.yaml
examples/librispeech/s1/conf/preprocess.yaml
+5
-5
paddlespeech/s2t/frontend/audio.py
paddlespeech/s2t/frontend/audio.py
+2
-2
paddlespeech/s2t/frontend/utility.py
paddlespeech/s2t/frontend/utility.py
+0
-1
paddlespeech/s2t/transform/spec_augment.py
paddlespeech/s2t/transform/spec_augment.py
+3
-0
paddlespeech/s2t/transform/spectrogram.py
paddlespeech/s2t/transform/spectrogram.py
+16
-24
未找到文件。
examples/librispeech/s1/conf/preprocess.yaml
浏览文件 @
9a71c091
...
...
@@ -10,16 +10,16 @@ process:
cmvn_path
:
data/mean_std.json
# these three processes are a.k.a. SpecAugument
-
type
:
time_warp
max_time_warp
:
0
max_time_warp
:
5
inplace
:
true
mode
:
PIL
-
type
:
freq_mask
F
:
1
0
F
:
3
0
n_mask
:
2
inplace
:
true
replace_with_zero
:
tru
e
replace_with_zero
:
fals
e
-
type
:
time_mask
T
:
5
0
T
:
4
0
n_mask
:
2
inplace
:
true
replace_with_zero
:
tru
e
replace_with_zero
:
fals
e
paddlespeech/s2t/frontend/audio.py
浏览文件 @
9a71c091
...
...
@@ -24,9 +24,9 @@ import soundfile
import
soxbindings
as
sox
from
scipy
import
signal
from
.utility
import
subfile_from_tar
from
.utility
import
convert_samples_to_float32
from
.utility
import
convert_samples_from_float32
from
.utility
import
convert_samples_to_float32
from
.utility
import
subfile_from_tar
class
AudioSegment
():
...
...
paddlespeech/s2t/frontend/utility.py
浏览文件 @
9a71c091
...
...
@@ -390,4 +390,3 @@ def convert_samples_from_float32(samples, dtype):
else
:
raise
TypeError
(
"Unsupported sample type: %s."
%
samples
.
dtype
)
return
output_samples
.
astype
(
dtype
)
paddlespeech/s2t/transform/spec_augment.py
浏览文件 @
9a71c091
...
...
@@ -34,6 +34,9 @@ def time_warp(x, max_time_warp=80, inplace=False, mode="PIL"):
:returns numpy.ndarray: time warped spectrogram (time, freq)
"""
window
=
max_time_warp
if
window
==
0
:
return
x
if
mode
==
"PIL"
:
t
=
x
.
shape
[
0
]
if
t
-
window
<=
window
:
...
...
paddlespeech/s2t/transform/spectrogram.py
浏览文件 @
9a71c091
...
...
@@ -307,9 +307,6 @@ class IStft():
center
=
self
.
center
,
)
from
paddlespeech.s2t.utils.log
import
Log
logger
=
Log
(
__name__
).
getlog
()
class
LogMelSpectrogramKaldi
():
def
__init__
(
self
,
...
...
@@ -347,22 +344,22 @@ class LogMelSpectrogramKaldi():
self
.
dither
=
dither
def
__repr__
(
self
):
return
(
"{name}(fs={fs}, n_mels={n_mels}, n_fft={n_fft}, "
"n_shift={n_shift}, win_length={win_length}, window={window}, "
"fmin={fmin}, fmax={fmax}, eps={eps}, preemph={preemph}, window={window}, dither={dither}))"
.
format
(
return
(
"{name}(fs={fs}, n_mels={n_mels}, n_fft={n_fft}, "
"n_shift={n_shift}, win_length={win_length}, preemph={preemph}, window={window}, "
"fmin={fmin}, fmax={fmax}, eps={eps}, dither={dither}))"
.
format
(
name
=
self
.
__class__
.
__name__
,
fs
=
self
.
fs
,
n_mels
=
self
.
n_mels
,
n_fft
=
self
.
n_fft
,
n_shift
=
self
.
n_shift
,
preemph
=
self
.
preemph
,
win_length
=
self
.
win_length
,
window
=
self
.
window
,
fmin
=
self
.
fmin
,
fmax
=
self
.
fmax
,
eps
=
self
.
eps
,
preemph
=
self
.
preemph
,
window
=
self
.
window
,
dither
=
self
.
dither
))
dither
=
self
.
dither
,
))
def
__call__
(
self
,
x
):
"""
...
...
@@ -379,12 +376,10 @@ class LogMelSpectrogramKaldi():
if
x
.
ndim
!=
1
:
raise
ValueError
(
"Not support x: [Time, Channel]"
)
logger
.
info
(
f
"in
{
x
}
"
)
if
x
.
dtype
in
np
.
sctypes
[
'float'
]:
# PCM32 -> PCM16
bits
=
np
.
iinfo
(
np
.
int16
).
bits
x
=
x
*
2
**
(
bits
-
1
)
logger
.
info
(
f
"b
{
x
}
"
)
# logfbank need PCM16 input
y
=
logfbank
(
...
...
@@ -400,7 +395,4 @@ class LogMelSpectrogramKaldi():
remove_dc_offset
=
self
.
remove_dc_offset
,
preemph
=
self
.
preemph
,
wintype
=
self
.
window
)
logger
.
info
(
f
"a
{
y
}
"
)
return
y
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录