Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleGAN
提交
d5b9c2ea
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看板
提交
d5b9c2ea
编写于
4年前
作者:
L
LielinJiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix url name
上级
93d8fca1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
11 addition
and
15 deletion
+11
-15
applications/DeOldify/predict.py
applications/DeOldify/predict.py
+3
-5
applications/DeepRemaster/predict.py
applications/DeepRemaster/predict.py
+2
-2
applications/EDVR/predict.py
applications/EDVR/predict.py
+3
-4
applications/RealSR/predict.py
applications/RealSR/predict.py
+3
-4
未找到文件。
applications/DeOldify/predict.py
浏览文件 @
d5b9c2ea
...
...
@@ -18,7 +18,6 @@ from paddle.utils.download import get_path_from_url
from
ppgan.utils.video
import
frames2video
,
video2frames
from
ppgan.models.generators.deoldify
import
build_model
parser
=
argparse
.
ArgumentParser
(
description
=
'DeOldify'
)
parser
.
add_argument
(
'--input'
,
type
=
str
,
default
=
'none'
,
help
=
'Input video'
)
parser
.
add_argument
(
'--output'
,
type
=
str
,
default
=
'output'
,
help
=
'output dir'
)
...
...
@@ -31,7 +30,7 @@ parser.add_argument('--weight_path',
default
=
None
,
help
=
'Path to the reference image directory'
)
D
eOldify_weight_url
=
'https://paddlegan.bj.bcebos.com/applications/DeOldify_stable.pdparams'
D
EOLDIFY_WEIGHT_URL
=
'https://paddlegan.bj.bcebos.com/applications/DeOldify_stable.pdparams'
class
DeOldifyPredictor
():
...
...
@@ -46,7 +45,7 @@ class DeOldifyPredictor():
self
.
render_factor
=
render_factor
self
.
model
=
build_model
()
if
weight_path
is
None
:
weight_path
=
get_path_from_url
(
D
eOldify_weight_url
,
cur_path
)
weight_path
=
get_path_from_url
(
D
EOLDIFY_WEIGHT_URL
,
cur_path
)
state_dict
,
_
=
paddle
.
load
(
weight_path
)
self
.
model
.
load_dict
(
state_dict
)
...
...
@@ -127,8 +126,7 @@ class DeOldifyPredictor():
vid_out_path
=
os
.
path
.
join
(
output_path
,
'{}_deoldify_out.mp4'
.
format
(
base_name
))
frames2video
(
frame_pattern_combined
,
vid_out_path
,
str
(
int
(
fps
)))
frames2video
(
frame_pattern_combined
,
vid_out_path
,
str
(
int
(
fps
)))
return
frame_pattern_combined
,
vid_out_path
...
...
This diff is collapsed.
Click to expand it.
applications/DeepRemaster/predict.py
浏览文件 @
d5b9c2ea
...
...
@@ -17,7 +17,7 @@ import utils
from
ppgan.models.generators.remaster
import
NetworkR
,
NetworkC
from
paddle.utils.download
import
get_path_from_url
D
eepRemaster_weight_url
=
'https://paddlegan.bj.bcebos.com/applications/deep_remaster.pdparams'
D
EEPREMASTER_WEIGHT_URL
=
'https://paddlegan.bj.bcebos.com/applications/deep_remaster.pdparams'
parser
=
argparse
.
ArgumentParser
(
description
=
'Remastering'
)
parser
.
add_argument
(
'--input'
,
type
=
str
,
default
=
None
,
help
=
'Input video'
)
...
...
@@ -51,7 +51,7 @@ class DeepReasterPredictor:
self
.
mindim
=
mindim
if
weight_path
is
None
:
weight_path
=
get_path_from_url
(
D
eepRemaster_weight_url
,
cur_path
)
weight_path
=
get_path_from_url
(
D
EEPREMASTER_WEIGHT_URL
,
cur_path
)
state_dict
,
_
=
paddle
.
load
(
weight_path
)
...
...
This diff is collapsed.
Click to expand it.
applications/EDVR/predict.py
浏览文件 @
d5b9c2ea
...
...
@@ -32,7 +32,7 @@ from data import EDVRDataset
from
paddle.utils.download
import
get_path_from_url
from
ppgan.utils.video
import
frames2video
,
video2frames
EDVR_
weight_url
=
'https://paddlegan.bj.bcebos.com/applications/edvr_infer_model.tar'
EDVR_
WEIGHT_URL
=
'https://paddlegan.bj.bcebos.com/applications/edvr_infer_model.tar'
def
parse_args
():
...
...
@@ -82,7 +82,7 @@ class EDVRPredictor:
self
.
exe
=
fluid
.
Executor
(
place
)
if
weight_path
is
None
:
weight_path
=
get_path_from_url
(
EDVR_
weight_url
,
cur_path
)
weight_path
=
get_path_from_url
(
EDVR_
WEIGHT_URL
,
cur_path
)
model_filename
=
'EDVR_model.pdmodel'
params_filename
=
'EDVR_params.pdparams'
...
...
@@ -141,8 +141,7 @@ class EDVRPredictor:
frame_pattern_combined
=
os
.
path
.
join
(
pred_frame_path
,
'%08d.png'
)
vid_out_path
=
os
.
path
.
join
(
self
.
output
,
'{}_edvr_out.mp4'
.
format
(
base_name
))
frames2video
(
frame_pattern_combined
,
vid_out_path
,
str
(
int
(
fps
)))
frames2video
(
frame_pattern_combined
,
vid_out_path
,
str
(
int
(
fps
)))
return
frame_pattern_combined
,
vid_out_path
...
...
This diff is collapsed.
Click to expand it.
applications/RealSR/predict.py
浏览文件 @
d5b9c2ea
...
...
@@ -26,7 +26,7 @@ parser.add_argument('--weight_path',
default
=
None
,
help
=
'Path to the reference image directory'
)
R
ealSR_weight_url
=
'https://paddlegan.bj.bcebos.com/applications/DF2K_JPEG.pdparams'
R
EALSR_WEIGHT_URL
=
'https://paddlegan.bj.bcebos.com/applications/DF2K_JPEG.pdparams'
class
RealSRPredictor
():
...
...
@@ -35,7 +35,7 @@ class RealSRPredictor():
self
.
output
=
os
.
path
.
join
(
output
,
'RealSR'
)
self
.
model
=
RRDBNet
(
3
,
3
,
64
,
23
)
if
weight_path
is
None
:
weight_path
=
get_path_from_url
(
R
ealSR_weight_url
,
cur_path
)
weight_path
=
get_path_from_url
(
R
EALSR_WEIGHT_URL
,
cur_path
)
state_dict
,
_
=
paddle
.
load
(
weight_path
)
self
.
model
.
load_dict
(
state_dict
)
...
...
@@ -88,8 +88,7 @@ class RealSRPredictor():
vid_out_path
=
os
.
path
.
join
(
output_path
,
'{}_realsr_out.mp4'
.
format
(
base_name
))
frames2video
(
frame_pattern_combined
,
vid_out_path
,
str
(
int
(
fps
)))
frames2video
(
frame_pattern_combined
,
vid_out_path
,
str
(
int
(
fps
)))
return
frame_pattern_combined
,
vid_out_path
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部