Creating fun images/videos by using Neural Style Transformation algorithms.
Some examples:
GIF of lion image being styled with cubist style:
This project is built upon PyTorch using Python 3.8+.
For GPU support install CUDA.
All modules used are in file requirements.txt
.
Install: terminal -> pip3 install -r requirements.txt
.
All parameters are setup in config.json
file.
Parameters:
image
- content image - name of content image, eg.lion.jpg
style
- style image - name of style image, eg.cubist.jpg
path_type
- type of path -relative
orabsolute
content_images_dir
- path to content images folder, eg.data/content_images/
style_images_dir
- path to style images folder, eg.data/style_images/
output_images_dir
- path to output images folder, eg.data/output_images/
freq
- how frequently will image be saved while training (1
means after every step,2
after every 2 steps,0
means only final image will be saved)video
- creating video from all training steps -True
orFalse
(only possible if frequency is >= 1)height
- height of an image - int number, eg.500
image_format
- in what format will image be saved - leave first value to be 4, second value can be.jpg
,.png
, etc.model
- which model will be used for optimizing -vgg16
orvgg19
optimizer
- which optimizer will model use - currently onlyadam
is supportedinit_method
- initialization method for image -content
orrandom
iterations
- number of iterations/epochs for training - int number, eg.400