Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

AdaIN

This is the implementation of "Adaptive Instance Normalization".
Original paper: X. Huang and S. Belongie. Arbitrary Style Transfer in Real-Time With Adaptive Instance Normalization. In Proceedings of the IEEE International Conference on Computer Vision, 2017. link

Usage

0. Download pre-trained model

Please download VGG19 pre-trained model with ImageNet.

$ wget https://huggingface.co/koba-jon/pre-train_cpp/resolve/main/models/vgg19_bn.pth

1. Build

Please build the source file according to the procedure.

$ mkdir build
$ cd build
$ cmake ..
$ make -j4
$ cd ..

2. Dataset Setting

Setting

The following hierarchical relationships are recommended.

datasets
|--Dataset1
|    |--content.png
|    |--style.png
|
|--Dataset2
|--Dataset3

3. Image Generation

Example 1

Setting

Please set the shell for executable file.

$ vi scripts/TheStarryNight.sh

The following is an example of the generation phase.
If you want to view specific examples of command line arguments, please view "src/main.cpp" or add "--help" to the argument.

#!/bin/bash

DATA='TheStarryNight'

./AdaIN \
    --generate true \
    --iterations 5000 \
    --dataset ${DATA} \
    --content "content.png" \
    --style "style.png" \
    --gpu_id 0
Run

Please execute the following to start the program.

$ sh scripts/TheStarryNight.sh

Example 2

Setting

Please set the shell for executable file.

$ vi scripts/TheScream.sh

The following is an example of the generation phase.
If you want to view specific examples of command line arguments, please view "src/main.cpp" or add "--help" to the argument.

#!/bin/bash

DATA='TheScream'

./AdaIN \
    --generate true \
    --iterations 5000 \
    --dataset ${DATA} \
    --content "content.png" \
    --style "style.png" \
    --gpu_id 0
Run

Please execute the following to start the program.

$ sh scripts/TheScream.sh