A tensorflow v2 implementation of fast style transfer method.
udnie style
wave style
styled video (click to play video)
download the pretrained models and save in ./model/
.
each model contains
- model weights
- generated test images
- loss logs for tensorboard
$ python evaluate.py --type image --weight model/udnie/weights.h5 --content input/udnie/chicago.jpg --output output/udnie/chicago.jpg
$ python evaluate.py --type video --weight model/udnie/weights.h5 --content input/video/fox.mp4 --output output/udnie/fox.avi
download coco2014 dataset in ./data
dir.
data/
└── train2014/
├── *.jpg
├── .....
├── .....
├── .....
└── *.jpg
e.g. train model using udnie style, chicago as test image, output model in model/udnie
dir.
$ python train.py --style-image input/style/udnie.jpg --test-image input/content/chicago.jpg --output model/udnie
launch tensorboard to check the training losses.
$ tensorboard --logdir ./model --bind_all
this project borrows the code from project lengstrom/fast-style-transfer but uses tf v2 and keras model.
this implementation is based on
- Supplementary material of Justin's paper Perceptual Losses for Real-Time Style Transfer and Super-Resolution
- Gatys' wonderful idea A Neural Algorithm of Artistic Style
- Ulyanov's Instance Normalization: The Missing Ingredient for Fast Stylization
also, Tensorflow official site and Justin's ppt in cs20si help a lot.