Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
u013913216
PaddleGAN
提交
46376659
P
PaddleGAN
项目概览
u013913216
/
PaddleGAN
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleGAN
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleGAN
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
46376659
编写于
9月 21, 2020
作者:
L
LielinJiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine code
上级
fda5a23f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
37 addition
and
69 deletion
+37
-69
applications/first_order_model/configs/vox-256.yaml
applications/first_order_model/configs/vox-256.yaml
+0
-55
applications/tools/first-order-demo.py
applications/tools/first-order-demo.py
+21
-8
applications/tools/video-enhance.py
applications/tools/video-enhance.py
+14
-0
ppgan/utils/animate.py
ppgan/utils/animate.py
+2
-6
未找到文件。
applications/first_order_model/configs/vox-256.yaml
浏览文件 @
46376659
dataset_params
:
root_dir
:
data/vox-png
frame_shape
:
[
256
,
256
,
3
]
id_sampling
:
True
pairs_list
:
data/vox256.csv
augmentation_params
:
flip_param
:
horizontal_flip
:
True
time_flip
:
True
jitter_param
:
brightness
:
0.1
contrast
:
0.1
saturation
:
0.1
hue
:
0.1
model_params
:
common_params
:
num_kp
:
10
...
...
@@ -42,42 +26,3 @@ model_params:
max_features
:
512
num_blocks
:
4
sn
:
True
train_params
:
num_epochs
:
100
num_repeats
:
75
epoch_milestones
:
[
60
,
90
]
lr_generator
:
2.0e-4
lr_discriminator
:
2.0e-4
lr_kp_detector
:
2.0e-4
batch_size
:
40
scales
:
[
1
,
0.5
,
0.25
,
0.125
]
checkpoint_freq
:
50
transform_params
:
sigma_affine
:
0.05
sigma_tps
:
0.005
points_tps
:
5
loss_weights
:
generator_gan
:
0
discriminator_gan
:
1
feature_matching
:
[
10
,
10
,
10
,
10
]
perceptual
:
[
10
,
10
,
10
,
10
,
10
]
equivariance_value
:
10
equivariance_jacobian
:
10
reconstruction_params
:
num_videos
:
1000
format
:
'
.mp4'
animate_params
:
num_pairs
:
50
format
:
'
.mp4'
normalization_params
:
adapt_movement_scale
:
False
use_relative_movement
:
True
use_relative_jacobian
:
True
visualizer_params
:
kp_size
:
5
draw_border
:
True
colormap
:
'
gist_rainbow'
applications/tools/first-order-demo.py
浏览文件 @
46376659
# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
matplotlib
matplotlib
.
use
(
'Agg'
)
import
os
...
...
@@ -5,20 +19,20 @@ import sys
import
yaml
import
pickle
from
argparse
import
ArgumentParser
from
tqdm
import
tqdm
import
imageio
import
numpy
as
np
from
skimage.transform
import
resize
from
tqdm
import
tqdm
from
skimage
import
img_as_ubyte
import
paddle
from
argparse
import
ArgumentParser
from
skimage.transform
import
resize
from
scipy.spatial
import
ConvexHull
from
ppgan.models.generators.occlusion_aware
import
OcclusionAwareGenerator
from
ppgan.modules.keypoint_detector
import
KPDetector
from
ppgan.utils.animate
import
normalize_kp
from
scipy.spatial
import
ConvexHull
import
paddle
paddle
.
disable_static
()
if
sys
.
version_info
[
0
]
<
3
:
...
...
@@ -60,8 +74,7 @@ def make_animation(source_image,
predictions
=
[]
source
=
paddle
.
to_tensor
(
source_image
[
np
.
newaxis
].
astype
(
np
.
float32
)).
transpose
([
0
,
3
,
1
,
2
])
# if not cpu:
# source = source.cuda()
driving
=
paddle
.
to_tensor
(
np
.
array
(
driving_video
)[
np
.
newaxis
].
astype
(
np
.
float32
)).
transpose
(
[
0
,
4
,
1
,
2
,
3
])
...
...
applications/tools/video-enhance.py
浏览文件 @
46376659
# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
sys
sys
.
path
.
append
(
'.'
)
...
...
ppgan/utils/animate.py
浏览文件 @
46376659
import
os
from
tqdm
import
tqdm
import
numpy
as
np
from
scipy.spatial
import
ConvexHull
import
paddle
import
imageio
from
scipy.spatial
import
ConvexHull
import
numpy
as
np
def
normalize_kp
(
kp_source
,
kp_driving
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录