Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mrywhh
Real-Time-Voice-Cloning
提交
ad7f01d5
R
Real-Time-Voice-Cloning
项目概览
mrywhh
/
Real-Time-Voice-Cloning
落后 Fork 源项目 12 个版本
从无法访问的项目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,发现更多精彩内容 >>
未验证
提交
ad7f01d5
编写于
7月 10, 2020
作者:
B
blue-fish
提交者:
GitHub
7月 10, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Print helpful error message if models not found (#416)
上级
6edc39eb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
3 deletion
+26
-3
demo_cli.py
demo_cli.py
+4
-0
demo_toolbox.py
demo_toolbox.py
+7
-3
utils/modelutils.py
utils/modelutils.py
+15
-0
未找到文件。
demo_cli.py
浏览文件 @
ad7f01d5
from
encoder.params_model
import
model_embedding_size
as
speaker_embedding_size
from
utils.argutils
import
print_args
from
utils.modelutils
import
check_model_paths
from
synthesizer.inference
import
Synthesizer
from
encoder
import
inference
as
encoder
from
vocoder
import
inference
as
vocoder
...
...
@@ -53,6 +54,9 @@ if __name__ == '__main__':
else
:
print
(
"Using CPU for inference.
\n
"
)
## Remind the user to download pretrained models if needed
check_model_paths
(
encoder_path
=
args
.
enc_model_fpath
,
synthesizer_path
=
args
.
syn_model_dir
,
vocoder_path
=
args
.
voc_model_fpath
)
## Load the models one by one.
print
(
"Preparing the encoder, the synthesizer and the vocoder..."
)
...
...
demo_toolbox.py
浏览文件 @
ad7f01d5
from
pathlib
import
Path
from
toolbox
import
Toolbox
from
utils.argutils
import
print_args
from
utils.modelutils
import
check_model_paths
import
argparse
...
...
@@ -26,8 +27,11 @@ if __name__ == '__main__':
"If True, the memory used by the synthesizer will be freed after each use. Adds large "
"overhead but allows to save some GPU memory for lower-end GPUs."
)
args
=
parser
.
parse_args
()
print_args
(
args
,
parser
)
## Remind the user to download pretrained models if needed
check_model_paths
(
encoder_path
=
args
.
enc_models_dir
,
synthesizer_path
=
args
.
syn_models_dir
,
vocoder_path
=
args
.
voc_models_dir
)
# Launch the toolbox
print_args
(
args
,
parser
)
Toolbox
(
**
vars
(
args
))
\ No newline at end of file
Toolbox
(
**
vars
(
args
))
utils/modelutils.py
0 → 100644
浏览文件 @
ad7f01d5
from
pathlib
import
Path
def
check_model_paths
(
encoder_path
:
Path
,
synthesizer_path
:
Path
,
vocoder_path
:
Path
):
# This function tests the model paths and makes sure at least one is valid.
if
encoder_path
.
is_file
()
or
encoder_path
.
is_dir
():
return
if
synthesizer_path
.
is_file
()
or
synthesizer_path
.
is_dir
():
return
if
vocoder_path
.
is_file
()
or
vocoder_path
.
is_dir
():
return
# If none of the paths exist, remind the user to download models if needed
print
(
"Error: Model files not found. If needed, download them here:"
)
print
(
"https://github.com/CorentinJ/Real-Time-Voice-Cloning/wiki/Pretrained-models
\n
"
)
quit
(
-
1
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录