Giter Club home page Giter Club logo

shadow-removal-via-generative-priors's Introduction

ShadowGP

This repository provides the official codes for our paper: Unsupervised Portrait Shadow Removal via Generative Priors (ACM MM 2021).

Unsupervised Portrait Shadow Removal via Generative Priors
Yingqing He*, Yazhou Xing*, Tianjia Zhang, Qifeng Chen (* indicates joint first authors)
HKUST

In this repository, we propose an unsupervised method for portrait shadow removal, named as ShadowGP. ShadowGP can recover a shadow-free portrait image via single image optimization, without a large paired training dataset, which is expensive to collect and time-consuming to train. Besides, our method can also be extended to facial tattoo removal and watermark removal tasks.

ShadowGP can decompose the single input shadowed portrait image into 3 parts: a full-shadow portrait, a shadow-free portrait and a shadow mask. Blending the three parts together can reconstruct the input shadowed portrait. The decomposed shadow-free portrait is the target output.


Install Environment

To install and activate the environment, run the following commands:

conda create -n shadowgp python=3.7
conda activate shadowgp
pip3 install torch==1.3.1+cu100 torchvision==0.4.2+cu100 -f https://download.pytorch.org/whl/torch_stable.html
pip3 install opencv-python tqdm scikit-image==0.15 Pillow==7.1.0 Ipython ninja

Our code has the same system requirements as StyleGAN2-PyTorch.


Download Checkpoints

Download the pretrained StyleGAN 550000.pt and the pretrained face segmentation model face-seg-BiSeNet-79999_iter.pth from the google drive, and put them in checkpoint/.

cd Shadow-Removal-via-Generative-Priors
mkdir checkpoint
mv ${YOUR_PATH}/550000.pt checkpoint/
mv ${YOUR_PATH}/face-seg-BiSeNet-79999_iter.pth checkpoint/

Optional: If the lpips checkpoint cannot be downloaded automatically, you can also manually download the weights.tar.gz to the project directory and run tar -zxvf weights.tar.gz. Then you will see the checkpoint in lpips/weights/v0.1/vgg.pth.

Run

bash run.sh

Then it will create a results folder including all the intermidiate results and the final output results in results/res.

Acknowledgement

Our code is built on StyleGAN2-PyTorch.


Citation

@inproceedings{he21unsupervised,
  title     = {Unsupervised Portrait Shadow Removal via Generative Priors},
  author    = {He, Yingqing and Xing, Yazhou and Zhang, Tianjia and Chen, Qifeng},
  booktitle = {ACM International Conference on Multimedia (ACM MM)},
  year      = {2021}
}

shadow-removal-via-generative-priors's People

Contributors

dionesiusap10 avatar yingqinghe avatar yzxing87 avatar

Watchers

 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.