Implementation of image style transfer in PyTorch. The paper outlining the transfer method can be found here.
You can install the required packages to run this notebook by running:
pip install -r requirements.txt
This notebook works on both CPU and GPU.
- Put the images you want to use for style transfer in the images folder.
- Change the
content_path
andstyle_path
to the respective images you want to use. - The output images will get exported to the output folder.
- Change the
style_weights
to change the effect of each style layer on the output (lower weights for later layers is preferrable). - The ratio of
content_weight
andstyle_weight
determines the trade-off between content and style of the image(lower ratio facilitates high rates of style transfer).
Content Image | Style image | Style transferred image |
---|---|---|
If you can't run the notebook on your device's GPU manually set the device
varaible to cpu
.