46

GitHub - taki0112/SPADE-Tensorflow: Simple Tensorflow implementation of "Se...

 4 years ago
source link: https://github.com/taki0112/SPADE-Tensorflow
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

Semantic Image Synthesis with SPADE (GauGAN) - Tensorflow

Simple Tensorflow implementation of "Semantic Image Synthesis with Spatially-Adaptive Normalization" (CVPR 2019 Oral)

68747470733a2f2f6e766c6162732e6769746875622e696f2f53504144452f696d616765732f74726565706f6e642e676966 68747470733a2f2f6e766c6162732e6769746875622e696f2f53504144452f696d616765732f6f6365616e2e676966

Project page | Paper | Pytorch code

Preparation

  • Image
  • Segmentation map
    • Don't worry. I do one-hot encoding of segmentation map automatically (whether color or gray).

Usage

├── dataset
   └── YOUR_DATASET_NAME
       ├── image
           ├── 000001.jpg 
           ├── 000002.png
           └── ...
       ├── segmap
           ├── 000001.jpg
           ├── 000002.png
           └── ...
       ├── segmap_test
           ├── a.jpg 
           ├── b.png
           └── ...
       ├── segmap_label.txt (Automatically created) 
       
├── guide.jpg (example for guided image translation task)

Train

> python main.py --dataset spade_celebA --img_ch 3 --segmap_ch 3 --phase train 

Random test

> python main.py --dataset spade_celebA --segmap_ch 3 --phase random

Guide test

> python main.py --dataset spade_celebA --img_ch 3 --segmap_ch 3 --phase guide --guide_img ./guide_img.png

Our Results

Loss grpah

loss.png

CityScape

cityscape_hinge.png

CelebA-HQ (Style Manipulation)

women_hinge.png

men_hinge.png

CelebA-HQ (Random Manipulation)

women_random_hinge.png

men_random_hinge.png

How about the Least-Square loss ?

CelebA-HQ (Style Manipulation)

women_lsgan.png

men_lsgan.png

CelebA-HQ (Random Manipulation)

women_random_lsgan.png

men_random_lsgan.png

Architecture

Generator Image Encoder Discriminator All-in-one generator.png image_encoder.png discriminator.png architecture.png

SPADE architecture

SPADE SPADE Residual Block spade.png spade_resblock.png

Author

Junho Kim


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK