Unofficial PyTorch implementation of real-time style transfer
Reference: Perceptual Losses for Real-Time Style Transfer and Super-Resolution, ECCV2016
- Pytorch (version >= 0.4.0)
- Pillow
- The trained models can be downloaded throuth the Google drive.
- MSCOCO train2014 is needed to train the network.
--train-flag
: Flag for train or evaluate transform network--train-content
: Path of content image dataset (MSCOCO is needed)--train-style
: Path of a target style image--test-content
: Path of a test content image--model-load-path
: Path of trained transform network to stylize the--test-content
image
python main.py --train-flag True --cuda-device-no 0 --imsize 256 --cropsize 240 --train-content ./coco2014/ --train-style imgs/style/mondrian.jpg --save-path trained_models/
python main.py --train-flag False --cuda-device-no 0 --imsize 256 --model-load-path trained_models/transform_network.pth --test-content imgs/content/chicago.jpg --output stylized.png