• Stars
    star
    272
  • Rank 150,322 (Top 3 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created almost 6 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CNN image style transfer 🎨.

Style Transfer

Style Transfer is a process in which we strive to modify the style of an image while preserving its content. Given an input image and a style image, we can compute an output image with the original content but a new style.

Kaggle kernel

Check out corresponding Medium article:

Style Transfer - Styling Images with Convolutional Neural Networks

How does it work?

  1. We take input image and style images and resize them to equal shapes.
  2. We load a pre-trained CNN (VGG16).
  3. Knowing that we can distinguish layers that are responsible for the style (basic shapes, colors etc.) and the ones responsible for the content (image-specific features), we can separate the layers to independently work on the content and style.
  4. Then we set our task as an optimization problem where we are going to minimize:
    • content loss (distance between the input and output images - we strive to preserve the content)
    • style loss (distance between the style and output images - we strive to apply a new style)
    • total variation loss (regularization - spatial smoothness to denoise the output image)
  5. Finally, we set our gradients and optimize with the L-BFGS algorithm.

Results

Input

Style

Output

1 iteration

2 iterations

5 iterations

10 iterations

15 iterations

Other examples

Author

Greg (Grzegorz) Surma

PORTFOLIO

GITHUB

BLOG

More Repositories

1

atari

AI research environment for the Atari 2600 games πŸ€–.
Python
247
star
2

image_generator

DCGAN image generator πŸ–ΌοΈ.
Jupyter Notebook
214
star
3

face_generator

DCGAN face generator πŸ§‘.
Jupyter Notebook
200
star
4

image_classifier

CNN image classifier implemented in Keras Notebook πŸ–ΌοΈ.
Jupyter Notebook
178
star
5

cartpole

OpenAI's cartpole env solver.
Python
143
star
6

text_predictor

Char-level RNN LSTM text generatorπŸ“„.
Python
113
star
7

slitherin

AI research environment for the game of Snake 🐍 .
Python
90
star
8

jetson

Self-driving AI toy car πŸ€–πŸš—.
Jupyter Notebook
80
star
9

metal_camera

iOS metal camera with GPU shaders.
Swift
73
star
10

pixelizator

Swift/Python image pixelizer πŸ–ΌοΈ.
Swift
68
star
11

deep_traffic

MIT DeepTraffic top 2% solution (75.01 mph) πŸš—.
JavaScript
56
star
12

password_cracker

Char-level RNN LSTM password cracker πŸ”‘πŸ”“.
55
star
13

stereo_depth_estimator

Stereo depth estimation for self-driving cars πŸš—
Python
49
star
14

edge_detector

HED real-time iOS edge detector.
Swift
43
star
15

deep_dream

DeepDream psychodelic image generator.
Python
39
star
16

sliding_puzzle

Swift implementation of the Sliding Puzzle game with Iterative Deepening A* AI Solver.
Swift
35
star
17

street_lanes_finder

Street lanes finder for self-driving carsπŸš—.
Jupyter Notebook
34
star
18

gsurma.github.io

Greg's Portfolio 🌎.
HTML
31
star
19

digit_recognizer

CNN digit recognizer implemented in Keras Notebook, Kaggle/MNIST (0.995).
Jupyter Notebook
30
star
20

meta_intelligence

AI research environment for program generation.
Python
27
star
21

histopathologic_cancer_detector

CNN histopathologic tumor identifier.
Jupyter Notebook
27
star
22

mono_depth_estimator

Mono depth estimation for self-driving cars πŸš—
Jupyter Notebook
24
star
23

image_tagger

CNN multi-label image classifier πŸ–ΌοΈ.
Jupyter Notebook
20
star
24

twitter_data_parser

Python scripts that download metadata and tweets for given users.
Python
18
star
25

prison_escape

Prisoner's Dilemma research environment.
Jupyter Notebook
16
star
26

cnn_explainer

Making CNNs interpretable.
Jupyter Notebook
15
star
27

newstagram

Simple iOS news feed app where you can customize categories and regions.
Swift
15
star
28

diffie_hellman_key_exchange

Swift implementation of classic cryptographic key exchange method.
Swift
15
star
29

prime_numbers_generator

Eratosthenes Sieve based prime numbers generator written in Swift.
Swift
11
star
30

sleepless_mac

Status bar app that prevents your mac from sleeping.
Swift
10
star
31

rpi_lcd_system_monitoring

Python scripts that display sytem data on i2c LCD screen.
Python
7
star
32

pong

iOS implementation of the classic Atari Pong game.
Swift
6
star
33

xcode_project_cleaner

Shell script that quickly cleans up xcode project.
Shell
6
star
34

game_of_life

NetLogo implementation of Conway's Game Of Life.
NetLogo
6
star
35

github_feed

Visually simple yet powerful github feed app.
Swift
4
star
36

stellar

Astronomy Photo of the Day πŸš€.
Swift
4
star
37

gsurma

3
star