# pytorch-CartoonGAN
Pytorch implementation of CartoonGAN [1] (CVPR 2018)
* Parameters without information in the paper were set arbitrarily.
* I used face-cropped celebA (src) and anime (tgt) collected from the web data because I could not find the author's data.
## Tensorflow version
[CartoonGAN-tensorflow](https://github.com/taki0112/CartoonGAN-Tensorflow)
## Usage
### 1.Download VGG19
[VGG19](https://download.pytorch.org/models/vgg19-dcbb9e9d.pth)
### 2.Train
```
python CartoonGAN.py --name your_project_name --src_data src_data_path --tgt_data tgt_data_path --vgg_model pre_trained_VGG19_model_path
```
### Folder structure
The following shows basic folder structure.
```
├── data
│ ├── src_data # src data (not included in this repo)
│ │ ├── train
│ │ └── test
│ └── tgt_data # tgt data (not included in this repo)
│ ├── train
│ └── pair # edge-promoting results to be saved here
│
├── CartoonGAN.py # training code
├── edge_promoting.py
├── utils.py
├── networks.py
└── name_results # results to be saved here
```
## Resutls
### paper results
<img src = 'assets/paper_results2.png'>
<img src = 'assets/paper_results.png'>
### celebA2anime face
### Initialization phase (reconstruction)
<table align='center'>
<tr align='center'>
<td> Input - Result (this repo) </td>
</tr>
<tr>
<td><img src = 'assets/Initialization_phase_result1.png'>
</tr>
<tr>
<td><img src = 'assets/Initialization_phase_result2.png'>
</tr>
<tr>
<td><img src = 'assets/Initialization_phase_result3.png'>
</tr>
</table>
### Cartoonization
* I got the author's results from [CaroonGAN-Test-Pytorch-Torch](https://github.com/Yijunmaverick/CartoonGAN-Test-Pytorch-Torch).
<table align='center'>
<tr align='center'>
<td> Input - Result (this repo) </td>
<td> Author's pre-trained model (Hayao) </td>
<td> Author's pre-trained model (Hosoda) </td>
</tr>
<tr>
<td><img src = 'assets/Cartoonization_result1.png'>
<td><img src = 'assets/00055_Hayao.jpg' height = '200px'>
<td><img src = 'assets/00055_Hosoda.jpg' height = '200px'>
</tr>
<tr>
<td><img src = 'assets/Cartoonization_result2.png'>
<td><img src = 'assets/00009_Hayao.jpg' height = '200px'>
<td><img src = 'assets/00009_Hosoda.jpg' height = '200px'>
</tr>
<tr>
<td><img src = 'assets/Cartoonization_result3.png'>
<td><img src = 'assets/00010_Hayao.jpg' height = '200px'>
<td><img src = 'assets/00010_Hosoda.jpg' height = '200px'>
</tr>
<tr>
<td><img src = 'assets/Cartoonization_result4.png'>
<td><img src = 'assets/00155_Hayao.jpg' height = '200px'>
<td><img src = 'assets/00155_Hosoda.jpg' height = '200px'>
</tr>
<tr>
<td><img src = 'assets/Cartoonization_result5.png'>
<td><img src = 'assets/00014_Hayao.jpg' height = '200px'>
<td><img src = 'assets/00014_Hosoda.jpg' height = '200px'>
</tr>
</table>
## Development Environment
* NVIDIA GTX 1080 ti
* cuda 8.0
* python 3.5.3
* pytorch 0.4.0
* torchvision 0.2.1
* opencv 3.2.0
## Reference
[1] Chen, Yang, Yu-Kun Lai, and Yong-Jin Liu. "CartoonGAN: Generative Adversarial Networks for Photo Cartoonization." Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2018.
(Full paper: http://openaccess.thecvf.com/content_cvpr_2018/papers/Chen_CartoonGAN_Generative_Adversarial_CVPR_2018_paper.pdf)
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Pytorch_implementation_of_CartoonGAN_(CVPR_2018)_pytorch-CartoonGAN.zip (28个子文件)
DataXujing-pytorch-CartoonGAN-67a872d
utils.py 1KB
assets
paper_results.png 584KB
00014_Hayao.jpg 26KB
Initialization_phase_result3.png 224KB
00009_Hayao.jpg 17KB
00055_Hayao.jpg 32KB
Cartoonization_result3.png 180KB
paper_results2.png 803KB
00009_Hosoda.jpg 14KB
00155_Hosoda.jpg 21KB
00055_Hosoda.jpg 33KB
Cartoonization_result4.png 180KB
00155_Hayao.jpg 26KB
Cartoonization_result2.png 152KB
Initialization_phase_result1.png 223KB
Cartoonization_result5.png 183KB
00014_Hosoda.jpg 22KB
00010_Hayao.jpg 23KB
Cartoonization_result1.png 205KB
00010_Hosoda.jpg 21KB
Initialization_phase_result2.png 189KB
data
README.md 32B
LICENSE 1KB
networks.py 5KB
edge_promoting.py 1KB
test.py 3KB
README.md 3KB
CartoonGAN.py 12KB
共 28 条
- 1
资源评论
好家伙VCC
- 粉丝: 2133
- 资源: 9145
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功