Git Product home page Git Product logo

scgan's Introduction

Image synthesis via semantic synthesis [Project Page]

by Yi Wang, Lu Qi, Ying-Cong Chen, Xiangyu Zhang, Jiaya Jia.

Introduction

This repository gives the implementation of our semantic image synthesis method in ICCV 2021 paper, 'Image synthesis via semantic synthesis'.

Teaser

Our framework

framework

Usage

git clone https://github.com/dvlab-research/SCGAN.git
cd SCGAN/code

To use this code, please install PyTorch 1.0 and Python 3+. Other dependencies can be installed by

pip install -r requirements.txt

Dataset Preparation

Please refer to SPADE for detailed execution.

Testing

  1. Downloading pretrained models, then putting the folder containing model weights in the folder ./checkpoints.

  2. Producing images with the pretrained models.

python test.py --gpu_ids 0,1,2,3 --dataset_mode [dataset] --config config/scgan_[dataset]_test.yml --fid --gt [gt_path] --visual_n 1

For example,

python test.py --gpu_ids 0,1,2,3 --dataset_mode celeba --config config/scgan_celeba-test.yml --fid --gt /data/datasets/celeba --visual_n 1
  1. Visual results are stored at ./results/scgan_[dataset]/ by default.

Pretrained Models (to be updated)

Dataset Download link
CelebAMask-HQ Baidu Disk (Code: face) or OneDrive
ADE20K Baidu Disk (Code: n021) or OneDrive| Visual results (Code: wu7b) or OneDrive
COCO Baidu Disk (Code: ss4b) or OneDrive| Visual results (Code: i4dw) or OneDrive

Training

Using train.sh to train new models. Or you can specify training options in config/[config_file].yml.

Key operators

Our proposed dynamic computation units (spatial conditional convolution and normalization) are extended from conditionally parameterized convolutions [1]. We generalize the scalar condition into a spatial one and also apply these techniques to normalization. sc-ops

Citation

If our research is useful for you, please consider citing:

@inproceedings{wang2021image,
  title={Image Synthesis via Semantic Composition},
  author={Wang, Yi and Qi, Lu and Chen, Ying-Cong and Zhang, Xiangyu and Jia, Jiaya},
  booktitle={ICCV},
  year={2021}
}

Acknowledgements

This code is built upon SPADE, Imaginaire, and PyTorch-FID.

Reference

[1] Brandon Yang, Gabriel Bender, Quoc V Le, and Jiquan Ngiam. Condconv: Conditionally parameterized convolutions for efficient inference. In NeurIPS. 2019.

Contact

Please send email to [email protected].

scgan's People

Contributors

shepnerd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

scgan's Issues

CelebA-HQ testing dataset

Hi, Thanks for sharing the code!

Could you provide more details about the data preparation of CelebA-HQ? For example, what's the channel order of each facial part?

lack of a file 'model.ops.local'

File "/content/drive/MyDrive/Hanary/SCGAN/SCGAN/model/net/discriminator.py", line 333, in
from model.ops.local import SpatialCondConv2dFast
ModuleNotFoundError: No module named 'model.ops.local'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.