Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
anquan13210
Real-Time-Voice-Cloning
提交
0908e4d3
R
Real-Time-Voice-Cloning
项目概览
anquan13210
/
Real-Time-Voice-Cloning
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Real-Time-Voice-Cloning
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
0908e4d3
编写于
6月 20, 2019
作者:
C
Corentin Jemine
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed some unused code
上级
5abcce45
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
9 addition
and
67 deletion
+9
-67
synthesizer/synthesize.py
synthesizer/synthesize.py
+0
-26
synthesizer/train.py
synthesizer/train.py
+7
-40
vocoder/display.py
vocoder/display.py
+1
-1
vocoder/models/deepmind_version.py
vocoder/models/deepmind_version.py
+1
-0
未找到文件。
synthesizer/synthesize.py
浏览文件 @
0908e4d3
...
...
@@ -82,29 +82,3 @@ def run_synthesis(in_dir, out_dir, model_dir, hparams):
print
(
"Synthesized mel spectrograms at {}"
.
format
(
synth_dir
))
return
meta_out_fpath
def
tacotron_synthesize
(
args
,
hparams
,
checkpoint
,
sentences
=
None
):
output_dir
=
args
.
output_dir
try
:
checkpoint_path
=
tf
.
train
.
get_checkpoint_state
(
checkpoint
).
model_checkpoint_path
log
(
"loaded model at {}"
.
format
(
checkpoint_path
))
except
:
raise
RuntimeError
(
"Failed to load checkpoint at {}"
.
format
(
checkpoint
))
if
hparams
.
tacotron_synthesis_batch_size
<
hparams
.
tacotron_num_gpus
:
raise
ValueError
(
"Defined synthesis batch size {} is smaller than minimum required {} "
"(num_gpus)! Please verify your synthesis batch size choice."
.
format
(
hparams
.
tacotron_synthesis_batch_size
,
hparams
.
tacotron_num_gpus
))
if
hparams
.
tacotron_synthesis_batch_size
%
hparams
.
tacotron_num_gpus
!=
0
:
raise
ValueError
(
"Defined synthesis batch size {} is not a multiple of {} (num_gpus)! "
"Please verify your synthesis batch size choice!"
.
format
(
hparams
.
tacotron_synthesis_batch_size
,
hparams
.
tacotron_num_gpus
))
if
args
.
mode
==
"eval"
:
return
run_eval
(
args
,
checkpoint_path
,
output_dir
,
hparams
,
sentences
)
elif
args
.
mode
==
"synthesis"
:
return
run_synthesis
(
args
,
checkpoint_path
,
output_dir
,
hparams
)
else
:
run_live
(
args
,
checkpoint_path
,
hparams
)
synthesizer/train.py
浏览文件 @
0908e4d3
...
...
@@ -330,46 +330,13 @@ def train(log_dir, args, hparams):
saver
.
save
(
sess
,
checkpoint_fpath
,
global_step
=
global_step
)
log
(
"
\n
Saving alignment, Mel-Spectrograms and griffin-lim inverted waveform.."
)
if
hparams
.
predict_linear
:
input_seq
,
mel_prediction
,
linear_prediction
,
alignment
,
target
,
target_length
,
linear_target
=
sess
.
run
(
[
model
.
tower_inputs
[
0
][
0
],
model
.
tower_mel_outputs
[
0
][
0
],
model
.
tower_linear_outputs
[
0
][
0
],
model
.
tower_alignments
[
0
][
0
],
model
.
tower_mel_targets
[
0
][
0
],
model
.
tower_targets_lengths
[
0
][
0
],
model
.
tower_linear_targets
[
0
][
0
],
])
# save predicted linear spectrogram to disk (debug)
linear_filename
=
"linear-prediction-step-{}.npy"
.
format
(
step
)
np
.
save
(
os
.
path
.
join
(
linear_dir
,
linear_filename
),
linear_prediction
.
T
,
allow_pickle
=
False
)
# save griffin lim inverted wav for debug (linear -> wav)
wav
=
audio
.
inv_linear_spectrogram
(
linear_prediction
.
T
,
hparams
)
audio
.
save_wav
(
wav
,
os
.
path
.
join
(
wav_dir
,
"step-{}-wave-from-linear.wav"
""
.
format
(
step
)),
sr
=
hparams
.
sample_rate
)
# Save real and predicted linear-spectrogram plot to disk (control purposes)
plot
.
plot_spectrogram
(
linear_prediction
,
os
.
path
.
join
(
plot_dir
,
"step-{}-linear-spectrogram.png"
.
format
(
step
)),
title
=
"{}, {}, step={}, loss={:.5f}"
.
format
(
"Tacotron"
,
time_string
(),
step
,
loss
),
target_spectrogram
=
linear_target
,
max_len
=
target_length
,
auto_aspect
=
True
)
else
:
input_seq
,
mel_prediction
,
alignment
,
target
,
target_length
=
sess
.
run
([
model
.
tower_inputs
[
0
][
0
],
model
.
tower_mel_outputs
[
0
][
0
],
model
.
tower_alignments
[
0
][
0
],
model
.
tower_mel_targets
[
0
][
0
],
model
.
tower_targets_lengths
[
0
][
0
],
])
input_seq
,
mel_prediction
,
alignment
,
target
,
target_length
=
sess
.
run
([
model
.
tower_inputs
[
0
][
0
],
model
.
tower_mel_outputs
[
0
][
0
],
model
.
tower_alignments
[
0
][
0
],
model
.
tower_mel_targets
[
0
][
0
],
model
.
tower_targets_lengths
[
0
][
0
],
])
# save predicted mel spectrogram to disk (debug)
mel_filename
=
"mel-prediction-step-{}.npy"
.
format
(
step
)
...
...
vocoder/display.py
浏览文件 @
0908e4d3
...
...
@@ -13,7 +13,7 @@ def progbar(i, n, size=16):
def
stream
(
message
)
:
sys
.
stdout
.
write
(
f
"
\r
{
message
}
"
)
sys
.
stdout
.
write
(
"
\r
{%s}"
%
message
)
def
simple_table
(
item_tuples
)
:
...
...
vocoder/models/deepmind_version.py
浏览文件 @
0908e4d3
...
...
@@ -4,6 +4,7 @@ import torch.nn.functional as F
from
utils.display
import
*
from
utils.dsp
import
*
class
WaveRNN
(
nn
.
Module
)
:
def
__init__
(
self
,
hidden_size
=
896
,
quantisation
=
256
)
:
super
(
WaveRNN
,
self
).
__init__
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录