GithubHelp home page GithubHelp logo

spmpgan's Introduction

Context-Consistent Semantic Image Editing with Style-Preserved Modulation (ECCV 2022)

Wuyang Luo, Su Yang, Hong Wang, Bo Long, Weishan Zhang

Paper (ArXiv)

SPMPGAN teaser

Requirements

  • The code has been tested with PyTorch 1.10.1 and Python 3.7.11. We train our model with a NIVIDA RTX3090 GPU.

Training

Dataset Preparation

Download Cityscapes or ADE20K. Create folder data/dataset_name/ with subfolders train/ and test/. train/ and test/ should each have their own subfolders images/, labels/, inst_map/.

  • images/: Original images.
  • labels/: Segmentation maps.
  • inst_map/(optional): Instance maps for generating edge maps. We find edge maps only have a slight impact. If there is no instance map, it can be omitted or replaced with segmentation map.

We include some examples in data/, so you can run the training without preparing the dataset. data/predefined_mask/ contains pre-generated mask maps for testing.

Train a model:

train.py --dataset_name cityscapes

Testing

Download pretrained model from BaiDuYun (password:z6jz) | GoogleDrive, run

test.py --dataset_name cityscapes  --ckt_path pretrained_models/cityscapes.pth --image_path data_test/input.jpg --segmap_path data_test/segmap_1.png --mask_path  data_test/mask_1.png

Citation:

If you use this code for your research, please cite our paper.

@article{luo2022context,
  title={Context-Consistent Semantic Image Editing with Style-Preserved Modulation},
  author={Luo, Wuyang and Yang, Su and Wang, Hong and Long, Bo and Zhang, Weishan},
  journal={arXiv preprint arXiv:2207.06252},
  year={2022}
}

Acknowledgment

Our code is developed based on SPADE.

spmpgan's People

Contributors

wuyangluo avatar xiaowangbaishui avatar

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.