/neural_style_transfer

A project of implementing image style transfer.

Primary LanguageJupyter Notebook

GitHub issues GitHub last commit

neural_style_transfer

Transfer a content image into the style of a style image.

  • A pre-trained VGG19 model is employed as feature extactor of content and style of an image.

  • A weighted loss function of content loss, style loss, and total variation loss is used as the optimization objective.

  • Visualize the feature maps to choose content and style layers.

  • Adam optimizer is used for training.

Preview

g2

g1

g3

Usage

Try the code in google colab if you are interested in. However, you need to prepare some images youselves. I did it by copying the images stored in my google drive. Open In Colab

Style transfer

Visualize feature maps

Only the first 10 feature maps of each conv layer are displayed.

Content feature maps

car1

Style feature maps

car2 car3 car4 car5 car6

Transfer results

 car

One to many

one_to_many

Many to one

many_to_one

Weight analysis

weight