Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Parakeet
提交
fd009bb0
P
Parakeet
项目概览
PaddlePaddle
/
Parakeet
通知
8
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Parakeet
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
fd009bb0
编写于
3月 06, 2020
作者:
C
chenfeiyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use os.path instead of pathlib.
上级
86fff7a0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
7 deletion
+6
-7
parakeet/datasets/ljspeech.py
parakeet/datasets/ljspeech.py
+4
-6
parakeet/models/waveflow/data.py
parakeet/models/waveflow/data.py
+2
-1
未找到文件。
parakeet/datasets/ljspeech.py
浏览文件 @
fd009bb0
...
...
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
pathlib
import
Path
import
os
import
numpy
as
np
import
pandas
as
pd
import
librosa
...
...
@@ -27,13 +27,11 @@ from ..data.batch import TextIDBatcher, SpecBatcher
class
LJSpeech
(
DatasetMixin
):
def
__init__
(
self
,
root
):
super
(
LJSpeech
,
self
).
__init__
()
assert
isinstance
(
root
,
(
str
,
Path
)),
"root should be a string or Path object"
self
.
root
=
root
if
isinstance
(
root
,
Path
)
else
Path
(
root
)
self
.
root
=
root
self
.
metadata
=
self
.
_prepare_metadata
()
def
_prepare_metadata
(
self
):
csv_path
=
self
.
root
.
joinpath
(
"metadata.csv"
)
csv_path
=
os
.
path
.
join
(
self
.
root
,
"metadata.csv"
)
metadata
=
pd
.
read_csv
(
csv_path
,
sep
=
"|"
,
...
...
@@ -51,7 +49,7 @@ class LJSpeech(DatasetMixin):
"""
fname
,
raw_text
,
normalized_text
=
metadatum
wav_path
=
self
.
root
.
joinpath
(
"wavs"
,
fname
+
".wav"
)
wav_path
=
os
.
path
.
join
(
self
.
root
,
"wavs"
,
fname
+
".wav"
)
# load -> trim -> preemphasis -> stft -> magnitude -> mel_scale -> logscale -> normalize
wav
,
sample_rate
=
librosa
.
load
(
...
...
parakeet/models/waveflow/data.py
浏览文件 @
fd009bb0
...
...
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
random
import
librosa
...
...
@@ -32,7 +33,7 @@ class Dataset(ljspeech.LJSpeech):
def
_get_example
(
self
,
metadatum
):
fname
,
_
,
_
=
metadatum
wav_path
=
self
.
root
.
joinpath
(
"wavs"
,
fname
+
".wav"
)
wav_path
=
os
.
path
.
join
(
self
.
root
,
"wavs"
,
fname
+
".wav"
)
loaded_sr
,
audio
=
read
(
wav_path
)
assert
loaded_sr
==
self
.
config
.
sample_rate
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录