https://github.com/bchao1/style-transfer
Neural style transfer implementation.
https://github.com/bchao1/style-transfer
neural-transfer pytorch style-transfer vgg19
Last synced: 7 months ago
JSON representation
Neural style transfer implementation.
- Host: GitHub
- URL: https://github.com/bchao1/style-transfer
- Owner: bchao1
- Created: 2018-09-20T03:51:47.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-26T16:54:32.000Z (about 7 years ago)
- Last Synced: 2025-01-28T03:14:40.665Z (9 months ago)
- Topics: neural-transfer, pytorch, style-transfer, vgg19
- Language: Python
- Homepage:
- Size: 21.7 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Style-Transfer
Simple implementation of the classic paper by Gatys et al. Please refer to the original paper for more detail: https://arxiv.org/abs/1508.0657.
## Usage
```
>> python3 style_transfer.py -h
usage: style_transfer.py [-h] [-d {cpu,cuda}] [-i ITERATIONS] [-c CONTENT]
[-s STYLE] [-o OUTPUT] [--output_dir OUTPUT_DIR]
[--content_dir CONTENT_DIR] [--style_dir STYLE_DIR]
[--style_weight STYLE_WEIGHT]
[--content_weight CONTENT_WEIGHT]
[--image_size IMAGE_SIZE]
optional arguments:
-h, --help show this help message and exit
-d {cpu,cuda}, --device {cpu,cuda}
Device to run style transfer on.
-i ITERATIONS, --iterations ITERATIONS
Number of style transfer iterations
-c CONTENT, --content CONTENT
Content image
-s STYLE, --style STYLE
Style image
-o OUTPUT, --output OUTPUT
Output image
--output_dir OUTPUT_DIR, --od OUTPUT_DIR
Where your output images are stored
--content_dir CONTENT_DIR, --cd CONTENT_DIR
Where your content images are stored
--style_dir STYLE_DIR, --sd STYLE_DIR
Where your style images are stored
--style_weight STYLE_WEIGHT, --sw STYLE_WEIGHT
Weight of style image
--content_weight CONTENT_WEIGHT, --cw CONTENT_WEIGHT
Weight of content image
--image_size IMAGE_SIZE, --sz IMAGE_SIZE
Weight of content image
```
## Overview

We extract `conv1_1, conv2_1, conv3_1, conv4_1, conv5_1` in VGG19 as the style layers, and `conv4_2` in VGG19 as the content layer. Our goal is to minimize the style and content losses of the generated image.
## Results
**Original image**

***
**Van gough style**

***
**Kanagawa style**

***
**Picasso style**

***
**Mondrian style**
