Skip to content

benbenlijie/style_transfer_tensorflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

style_transfer_tensorflow

A tensorflow implementation for Perceptual Losses for Real-Time Style Transfer and Super-Resolution. In this project, I build a model with Tensorflow and slim for image style transfer.

Result:

sample origin

Train a Model:

Preparetion:

  1. download VGG16 model from Tensorflow Slim. Extract the file vgg_16.ckpt. Then copy it to the folder pretrained/
  2. download COCO dataset. Please unzip it.
  3. convert the COCO images to tfrecord file by follow command:
python data_loader/dataset_create.py

It will create a image.tfrecord file placed at folder datasets

Train:

python transfer.py -c conf/candy.yml

Tensorboard:

tensorboard --logdir logs/candy

Model checkpoints

saved at models/candy

Tansfer a picture with trained model:

python evaluate.py -c conf/candy.yml -i img/test.jpg

A style transfered image named {style_name}_styled_test.jpg will be created and placed at the same folder as the input image.

Transfer style but not color

If you add the flag --origin_color then the output image will retain the colors of the original image

About

Style transfer with tensorflow

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages