Chainer implementation of waifu2x [1] and its model trainer. Note that the training procedure of waifu2x-chainer may be slightly different from original waifu2x.
- 2D character picture (Kagamine Rin) is licensed under CC BY-NC by piapro [2].
- Chainer
- Cupy (for GPU support)
- Pillow
- Wand (for training)
pip install chainer
pip install cupy
pip install pillow
pip install wand
git clone https://github.com/tsurumeso/waifu2x-chainer.git
cd waifu2x-chainer
python waifu2x.py
Specifing an output file name with --output (-o) option, the file extension must be PNG.
--output path/to/image.png/or/directory
python waifu2x.py --method noise --noise_level 1 --input path/to/image/or/directory --arch VGG7
python waifu2x.py -m noise -n 0 -i path/to/image/or/directory -a 0
python waifu2x.py -m noise -n 2 -i path/to/image/or/directory -a 0
python waifu2x.py -m noise -n 3 -i path/to/image/or/directory -a 0
python waifu2x.py --method scale --input path/to/image/or/directory --arch VGG7
python waifu2x.py -m scale -i path/to/image/or/directory -a 0
python waifu2x.py --method noise_scale --noise_level 1 --input path/to/image/or/directory --arch VGG7
python waifu2x.py -m noise_scale -n 0 -i path/to/image/or/directory -a 0
python waifu2x.py -m noise_scale -n 2 -i path/to/image/or/directory -a 0
python waifu2x.py -m noise_scale -n 3 -i path/to/image/or/directory -a 0
Please refer template script at appendix/linux or appendix/windows . In my case, 5000 JPEG images are used for pretraining and 1000 noise-free-PNG images for finetuning.
- [1] nagadomi, "Image Super-Resolution for Anime-Style Art", https://github.com/nagadomi/waifu2x
- [2] "For Creators", http://piapro.net/en_for_creators.html