Need help with CartoonGAN-Test-Pytorch-Torch?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

Yijunmaverick
579 Stars 178 Forks MIT License 34 Commits 16 Opened issues

Description

Pytorch and Torch testing code of CartoonGAN [Chen et al., CVPR18]

Services available

!
?

Need anything else?

Contributors list

# 16,423
MATLAB
Shell
Lua
33 commits

CartoonGAN-Test-Pytorch-Torch

Pytorch and Torch testing code of CartoonGAN

[Chen et al., CVPR18]
. With the released pretrained models by the authors, I made these simple scripts for a quick test.

Getting started

  • Linux
  • NVIDIA GPU
  • Pytorch 0.3
  • Torch
git clone https://github.com/Yijunmaverick/CartoonGAN-Test-Pytorch-Torch
cd CartoonGAN-Test-Pytorch-Torch

Pytorch

The original pretrained models are Torch

nngraph
models, which cannot be loaded in Pytorch through
load_lua
. So I manually copy the weights (bias) layer by layer and convert them to
.pth
models.
  • Download the converted models:
sh pretrained_model/download_pth.sh
  • For testing:
python test.py --input_dir YourImgDir --style Hosoda --gpu 0

Torch

Working with the original models in Torch is also fine. I just convert the weights (bias) in their models from CudaTensor to FloatTensor so that

cudnn
is not required for loading models.
  • Download the converted models:
sh pretrained_model/download_t7.sh
  • For testing:
th test.lua -input_dir YourImgDir -style Hosoda -gpu 0

Examples (Left: input, Right: output)

Note

  • The training code should be similar to the popular GAN-based image-translation frameworks and thus is not included here.

Acknowledgement

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.