Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleGAN
提交
c054d6ab
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看板
提交
c054d6ab
编写于
10月 20, 2020
作者:
L
LielinJiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update readme
上级
e4932b70
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
146 addition
and
3 deletion
+146
-3
README.md
README.md
+12
-0
README_cn.md
README_cn.md
+10
-0
applications/tools/video-enhance.py
applications/tools/video-enhance.py
+119
-0
docs/data_prepare.md
docs/data_prepare.md
+0
-1
docs/get_started.md
docs/get_started.md
+5
-2
未找到文件。
README.md
浏览文件 @
c054d6ab
...
...
@@ -4,8 +4,14 @@ English | [简体中文](./README_cn.md)
PaddleGAN is an development kit of Generative Adversarial Network based on PaddlePaddle.
### old video restore
![](
./docs/imgs/color_sr_peking.gif
)
### super resolution
![](
./docs/imgs/sr_demo.png
)
Features:
-
Highly Flexible:
...
...
@@ -31,6 +37,12 @@ pip install -U paddlepaddle-gpu
```
### 2. install ppgan
```
python -m pip install 'git+https://github.com/PaddlePaddle/PaddleGAN.git'
```
Or install it from a local clone
```
git clone https://github.com/PaddlePaddle/PaddleGAN
cd PaddleGAN
...
...
README_cn.md
浏览文件 @
c054d6ab
...
...
@@ -4,8 +4,13 @@
PaddleGAN 是一个基于飞桨的生成对抗网络开发工具包.
### 老视频修复
![](
./docs/imgs/color_sr_peking.gif
)
### 超分辨率
![](
./docs/imgs/sr_demo.png
)
特性:
-
高度的灵活性:
...
...
@@ -30,6 +35,11 @@ pip install -U paddlepaddle-gpu
### 2. 安装ppgan
```
python -m pip install 'git+https://github.com/PaddlePaddle/PaddleGAN.git'
```
或者通过将项目克隆到本地
```
git clone https://github.com/PaddlePaddle/PaddleGAN
cd PaddleGAN
...
...
applications/tools/video-enhance.py
浏览文件 @
c054d6ab
# 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
argparse
import
paddle
from
ppgan.apps
import
DAINPredictor
from
ppgan.apps
import
DeepRemasterPredictor
from
ppgan.apps
import
DeOldifyPredictor
from
ppgan.apps
import
RealSRPredictor
from
ppgan.apps
import
EDVRPredictor
parser
=
argparse
.
ArgumentParser
(
description
=
'Fix video'
)
parser
.
add_argument
(
'--input'
,
type
=
str
,
default
=
None
,
help
=
'Input video'
)
parser
.
add_argument
(
'--output'
,
type
=
str
,
default
=
'output'
,
help
=
'output dir'
)
parser
.
add_argument
(
'--DAIN_weight'
,
type
=
str
,
default
=
None
,
help
=
'Path to model weight'
)
parser
.
add_argument
(
'--DeepRemaster_weight'
,
type
=
str
,
default
=
None
,
help
=
'Path to model weight'
)
parser
.
add_argument
(
'--DeOldify_weight'
,
type
=
str
,
default
=
None
,
help
=
'Path to model weight'
)
parser
.
add_argument
(
'--RealSR_weight'
,
type
=
str
,
default
=
None
,
help
=
'Path to model weight'
)
parser
.
add_argument
(
'--EDVR_weight'
,
type
=
str
,
default
=
None
,
help
=
'Path to model weight'
)
# DAIN args
parser
.
add_argument
(
'--time_step'
,
type
=
float
,
default
=
0.5
,
help
=
'choose the time steps'
)
# DeepRemaster args
parser
.
add_argument
(
'--reference_dir'
,
type
=
str
,
default
=
None
,
help
=
'Path to the reference image directory'
)
parser
.
add_argument
(
'--colorization'
,
action
=
'store_true'
,
default
=
False
,
help
=
'Remaster with colorization'
)
parser
.
add_argument
(
'--mindim'
,
type
=
int
,
default
=
360
,
help
=
'Length of minimum image edges'
)
# DeOldify args
parser
.
add_argument
(
'--render_factor'
,
type
=
int
,
default
=
32
,
help
=
'model inputsize=render_factor*16'
)
#process order support model name:[DAIN, DeepRemaster, DeOldify, RealSR, EDVR]
parser
.
add_argument
(
'--proccess_order'
,
type
=
str
,
default
=
'none'
,
nargs
=
'+'
,
help
=
'Process order'
)
if
__name__
==
"__main__"
:
args
=
parser
.
parse_args
()
orders
=
args
.
proccess_order
temp_video_path
=
None
for
order
in
orders
:
print
(
'Model {} proccess start..'
.
format
(
order
))
if
temp_video_path
is
None
:
temp_video_path
=
args
.
input
if
order
==
'DAIN'
:
paddle
.
enable_static
()
predictor
=
DAINPredictor
(
args
.
output
,
weight_path
=
args
.
DAIN_weight
,
time_step
=
args
.
time_step
)
frames_path
,
temp_video_path
=
predictor
.
run
(
temp_video_path
)
paddle
.
disable_static
()
elif
order
==
'DeepRemaster'
:
predictor
=
DeepRemasterPredictor
(
args
.
output
,
weight_path
=
args
.
DeepRemaster_weight
,
colorization
=
args
.
colorization
,
reference_dir
=
args
.
reference_dir
,
mindim
=
args
.
mindim
)
frames_path
,
temp_video_path
=
predictor
.
run
(
temp_video_path
)
elif
order
==
'DeOldify'
:
predictor
=
DeOldifyPredictor
(
args
.
output
,
weight_path
=
args
.
DeOldify_weight
,
render_factor
=
args
.
render_factor
)
frames_path
,
temp_video_path
=
predictor
.
run
(
temp_video_path
)
elif
order
==
'RealSR'
:
predictor
=
RealSRPredictor
(
args
.
output
,
weight_path
=
args
.
RealSR_weight
)
frames_path
,
temp_video_path
=
predictor
.
run
(
temp_video_path
)
elif
order
==
'EDVR'
:
paddle
.
enable_static
()
predictor
=
EDVRPredictor
(
args
.
output
,
weight_path
=
args
.
EDVR_weight
)
frames_path
,
temp_video_path
=
predictor
.
run
(
temp_video_path
)
paddle
.
disable_static
()
print
(
'Model {} output frames path:'
.
format
(
order
),
frames_path
)
print
(
'Model {} output video path:'
.
format
(
order
),
temp_video_path
)
print
(
'Model {} proccess done!'
.
format
(
order
))
docs/data_prepare.md
浏览文件 @
c054d6ab
...
...
@@ -31,6 +31,5 @@ PaddleGAN
### cyclegan datasets
more dataset for cyclegan you can download from
[
here
](
https://people.eecs.berkeley.edu/~taesung_park/CycleGAN/datasets/
)
### pix2pix datasets
more dataset for pix2pix you can download from
[
here
](
hhttps://people.eecs.berkeley.edu/~tinghuiz/projects/pix2pix/datasets/
)
docs/get_started.md
浏览文件 @
c054d6ab
## Train
## Getting started with PaddleGAN
### Train
```
python -u tools/main.py --config-file configs/cyclegan_cityscapes.yaml
```
...
...
@@ -13,7 +16,7 @@ multiple gpus train:
CUDA_VISIBLE_DEVICES=0,1 python -m paddle.distributed.launch tools/main.py --config-file configs/pix2pix_cityscapes.yaml
```
## Evaluate
##
#
Evaluate
```
python tools/main.py --config-file configs/cyclegan_cityscapes.yaml --evaluate-only --load your_weight_path
```
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录