Skip to content

Implementation of the neural style transfer paper titled "Image Style Transfer Using Convolutional Neural Networks" using PyTorch.

License

Notifications You must be signed in to change notification settings

the-neural-networker/neural-style-transfer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neural Style Transfer with PyTorch

Description

Pytorch implementation of the Neural Style Transfer algorithm. Link to the original paper by Gatys et al.

How to run

First, install dependencies (a new python virtual environment is recommended).

# clone project   
git clone https://github.com/visualCalculus/neural-style-transfer

# install project   
cd neural-style-transfer
pip install -e .
pip install -r requirements.txt

Next, navigate to nst folder and run train.py with appropriate content and style image paths.

# module folder
cd nst

CONTENT_DIR={path to content image}
STYLE_DIR={path to style image}
OUTPUT_DIR={path to save result image}

# run module
python train.py --use_gpu=true --content_dir=${CONTENT_DIR} \
--style_dir=${STYLE_DIR} --input_image="content" \
--output_dir=${OUTPUT_DIR} --iterations=100 \ 
--alpha=1 --beta=1000000 \ 
--style_layer_weight=1.0

Results

result1 result2 result3

Citation

@misc{visualCalculus2021nst,
  title={neural-style-transfer},
  author={Tejomay, Abhiroop},
  publisher={GitHub}
  journal={GitHub repository},
  year={2021},
  howpublished={\url{https://github.com/visualCalculus/neural-style-transfer}}
}

About

Implementation of the neural style transfer paper titled "Image Style Transfer Using Convolutional Neural Networks" using PyTorch.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages