Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/syz825211943/Multi-Style-Photo-Cartoonization
https://github.com/syz825211943/Multi-Style-Photo-Cartoonization
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/syz825211943/Multi-Style-Photo-Cartoonization
- Owner: syz825211943
- License: bsd-2-clause
- Created: 2021-03-20T09:11:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-29T09:09:34.000Z (over 3 years ago)
- Last Synced: 2024-06-24T05:55:20.283Z (5 months ago)
- Language: Python
- Size: 4.93 MB
- Stars: 43
- Watchers: 2
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- StarryDivineSky - syz825211943/Multi-Style-Photo-Cartoonization
README
# Multi-Style Photo Cartoonization
Pytorch implement of Yezhi Shu, Ran Yi, Mengfei Xia, Zipeng Ye, Wang Zhao, Yang Chen, Yu-Kun Lai, Yong-Jin Liu. GAN-based Multi-Style Photo Cartoonization. IEEE Transactions on Visualization and Computer Graphics, DOI (identifier) 10.1109/TVCG.2021.3067201, 2021.## Our Proposed Framework
## Results
# Installation
Install PyTorch 1.2.0+ and torchvision from http://pytorch.org and other dependencies could be downloaded by
```bash
pip install -r requirements.txt
```
# Train
- Prepare your own dataset and put it under the dataset folder. Note that your own dataset should contain subfoloders: train0, train1_[style1name], train2_[style2name], ..., edge1_[style1name], edge2_[style2name], ..., test0. Different style names corresponding to different styles you have collected.
```bash
├─datasets
├─dataset name
├─ edge1_[style1name]
├─ edge2_[style2name]
├─ edge3_[style3name]
├─ test0
├─ train0
├─ train1_[style1name]
├─ train2_[style2name]
└─ train3_[style3name]
```
- Download the vgg19.pth from BaiduYun (https://pan.baidu.com/s/1zHx06jMfIUIdBY_X3ko6LA, extract code is z9p7) or Googledrive (https://drive.google.com/drive/folders/1jOSl_sBpGzm1wAvLgU5vDJOV9tg2PzIc?usp=sharing). Put it under Multi-Style Photo Cartoonization folder.
- Train the model using the commond. Set --init to use initialization phase. If you have pretrained model, you can set --continue_train and --which_epoch simultaneously.
```bash
python train.py --init --name train --dataroot [your dataset path]
```# Test
- You can use your own trained model to test the model, also you can download pretrained models by the link below.
- Put test real-world photo in test0 folder of your dataset.
```bash
python test.py --name train --serial_test --dataroot [your dataset path] --which_epoch 145
```# Citation
# Reference code
- CycleGAN (https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix)
- CartoonGAN (https://github.com/FlyingGoblin/CartoonGAN)
- ComboGAN (https://github.com/AAnoosheh/ComboGAN)