Skip to content

ptran1203/photorealistic_style_transfer

Repository files navigation

photorealistic_style_transfer Open In Colab

Photorealistic Style Transfer via Wavelet Transforms - https://arxiv.org/abs/1903.09760

Keras + tensorflow implementation of WCT2.

Original implementation in PyTorch by Jaejun-yoo

1. Usage

1.1 Download dataset

wget -O https://github.com/ptran1203/photorealistic_style_transfer/releases/download/v1.0/tfrecords.zip
unzip tfrecords.zip

1.2 Train

python3 train.py --train-tfrec tfrecords/train.tfrec\
                 --epochs 10
                 --batch-size 8
                 --checkpoint-path /content/ckp/wtc2.h5     # Save to this path
                 --resume                                   # Continue training
                 --lr 1e-4

1.3 Inference

!python3 inference.py --content /content/photorealistic_style_transfer/examples/input/in21.png\
                    --style /content/photorealistic_style_transfer/examples/style\
                    --output /content/tests

2. Results

Content Style Result
c1 g1 g1
c1 g1 g1
c1 g1 g1
c1 g1 g1
c1 g1 g1
c1 g1 g1
c1 g1 g1
c1 g1 g1
c1 g1 g1

Without segmentation map, model failed to transfer the images properly

c1 g1 g1