Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleGAN
提交
6d5b4eb4
P
PaddleGAN
项目概览
PaddlePaddle
/
PaddleGAN
1 年多 前同步成功
通知
97
Star
7254
Fork
1210
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleGAN
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
6d5b4eb4
编写于
2月 26, 2021
作者:
L
lijianshe02
提交者:
GitHub
2月 26, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix some errors in test (#179)
* fix some errors in test
上级
073df08d
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
8 deletion
+15
-8
docs/en_US/tutorials/face_parse.md
docs/en_US/tutorials/face_parse.md
+1
-1
docs/en_US/tutorials/psgan.md
docs/en_US/tutorials/psgan.md
+1
-1
docs/zh_CN/tutorials/face_parse.md
docs/zh_CN/tutorials/face_parse.md
+1
-1
docs/zh_CN/tutorials/psgan.md
docs/zh_CN/tutorials/psgan.md
+1
-1
ppgan/apps/psgan_predictor.py
ppgan/apps/psgan_predictor.py
+4
-4
ppgan/models/makeup_model.py
ppgan/models/makeup_model.py
+7
-0
未找到文件。
docs/en_US/tutorials/face_parse.md
浏览文件 @
6d5b4eb4
...
...
@@ -12,7 +12,7 @@ Runing the following command to complete the face parsing task. The output resul
```
cd applications
python face_parse.py --input_image ../docs/imgs/face.png
python
tools/
face_parse.py --input_image ../docs/imgs/face.png
```
**params:**
...
...
docs/en_US/tutorials/psgan.md
浏览文件 @
6d5b4eb4
...
...
@@ -20,7 +20,7 @@ python tools/psgan_infer.py \
--model_path /your/model/path \
--source_path docs/imgs/ps_source.png \
--reference_dir docs/imgs/ref \
--evaluate-only
True
--evaluate-only
```
**params:**
-
config-file: PSGAN network configuration file, yaml format
...
...
docs/zh_CN/tutorials/face_parse.md
浏览文件 @
6d5b4eb4
...
...
@@ -10,7 +10,7 @@
运行如下命令,可以完成人脸解析任务,程序运行成功后,会在
`output`
文件夹生成解析后的图片文件。具体命令如下所示:
```
cd applications
python face_parse.py --input_image ../docs/imgs/face.png
python
tools/
face_parse.py --input_image ../docs/imgs/face.png
```
**参数:**
...
...
docs/zh_CN/tutorials/psgan.md
浏览文件 @
6d5b4eb4
...
...
@@ -20,7 +20,7 @@ python tools/psgan_infer.py \
--model_path /your/model/path \
--source_path docs/imgs/ps_source.png \
--reference_dir docs/imgs/ref \
--evaluate-only
True
--evaluate-only
```
**参数说明:**
-
config-file: PSGAN网络到参数配置文件,格式为yaml
...
...
ppgan/apps/psgan_predictor.py
浏览文件 @
6d5b4eb4
...
...
@@ -22,12 +22,12 @@ import numpy as np
import
paddle
import
paddle.vision.transforms
as
T
from
paddle.utils.download
import
get_weights_path_from_url
import
ppgan.faceutils
as
futils
from
ppgan.utils.options
import
parse_args
from
ppgan.utils.config
import
get_config
from
ppgan.utils.setup
import
setup
from
ppgan.utils.filesystem
import
load
from
ppgan.engine.trainer
import
Trainer
from
ppgan.models.builder
import
build_model
from
ppgan.utils.preprocess
import
*
from
.base_predictor
import
BasePredictor
...
...
@@ -120,7 +120,7 @@ class PostProcess:
class
Inference
:
def
__init__
(
self
,
config
,
model_path
=
''
):
self
.
model
=
build_model
(
config
)
self
.
model
=
build_model
(
config
.
model
)
self
.
preprocess
=
PreProcess
(
config
)
self
.
model_path
=
model_path
...
...
@@ -154,6 +154,7 @@ class Inference:
'P_B'
:
reference_input
[
2
],
'consis_mask'
:
consis_mask
}
state_dicts
=
load
(
self
.
model_path
)
for
net_name
,
net
in
self
.
model
.
nets
.
items
():
net
.
set_state_dict
(
state_dicts
[
net_name
])
...
...
@@ -175,8 +176,7 @@ class PSGANPredictor(BasePredictor):
self
.
cfg
=
cfg
self
.
weight_path
=
self
.
args
.
model_path
if
self
.
weight_path
is
None
:
cur_path
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
self
.
weight_path
=
get_path_from_url
(
PS_WEIGHT_URL
,
cur_path
)
self
.
weight_path
=
get_weights_path_from_url
(
PS_WEIGHT_URL
)
self
.
output_path
=
output_path
def
run
(
self
):
...
...
ppgan/models/makeup_model.py
浏览文件 @
6d5b4eb4
...
...
@@ -141,6 +141,13 @@ class MakeupModel(BaseModel):
self
.
visual_items
[
'fake_A'
]
=
self
.
fake_A
self
.
visual_items
[
'rec_B'
]
=
self
.
rec_B
def
test
(
self
,
input
):
with
paddle
.
no_grad
():
return
self
.
nets
[
'netG'
](
input
[
'image_A'
],
input
[
'image_B'
],
input
[
'P_A'
],
input
[
'P_B'
],
input
[
'consis_mask'
],
input
[
'mask_A_aug'
],
input
[
'mask_B_aug'
])
def
backward_D_basic
(
self
,
netD
,
real
,
fake
):
"""Calculate GAN loss for the discriminator
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录