This is a TensorFlow implementation of the paper A Neural Algorithm of Artistic Style by Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge.
- Pre-trained VGG-19 model: VGG-19
- Content image: The image on which you want to apply the style
- Style image: The image from which you want to extract the style
- Output directory: The directory where the output image will be saved
- TensorFlow
- NumPy
- Scikit-image
- Pillow
- SciPy
To install the required packages, run the following command:
conda env create -f environment.yml
conda acrivate style_transfer
This will create a new conda environment called style_transfer
and install the required packages. You can activate the environment by running conda activate style_transfer
.
To apply the style of the style image to the content image, run the following command:
python style_transfer.py --content imgs/content.jpg --styles imgs/style.jpg --output imgs/output.jpg
This will apply the style of the style image to the content image and save the result in the output directory.
This repository does not include the content image. You can use any image you want to apply the style to. The style image is included in the imgs
directory.
You can use the following command to apply the style of the style image to the content image using the different optimizer [adam, adagrad, adadelta]:
python style_transfer.py --content imgs/content.jpg --styles imgs/style.jpg --output imgs/output_adadelta.jpg --optimizer adadelta
Style | Output |