Git Product home page Git Product logo

semantic-carigans's Introduction

Semantic-CariGANs

PyTorch implementation for "Learning to Caricature via Semantic Shape Transformation". This paper has been accepted to International Journal of Computer Vision (IJCV).

Authors

Wenqing Chu, Wei-Chih Hung, Yi-Hsuan Tsai, Yu-Ting Chang, Yijun Li, Deng Cai, Ming-Hsuan Yang

Dataset

Introduction

Caricature is an artistic drawing created to abstract or exaggerate facial features of a person. Rendering visually pleasing caricatures is a difficult task that requires professional skills, and thus it is of great interest to design a method to automatically generate such drawings. To deal with large shape changes, we propose an algorithm based on a semantic shape transform to produce diverse and plausible shape exaggerations. Specifically, we predict pixel-wise semantic correspondences and perform image warping on the input photo to achieve dense shape transformation. We show that the proposed framework is able to render visually pleasing shape exaggerations while maintaining their facial structures. In addition, our model allows users to manipulate the shape via the semantic map. We demonstrate the effectiveness of our approach on a large photograph-caricature benchmark dataset with comparisons to the state-of-the-art methods.

The image below shows some example results of our method:

Dependency

  • PyTorch >= 0.4.1
  • Python = 3.6

Usage

Our method has four parts, segmentation, retrieval, shape transformation and style transfer. We provide the pretrained segmentation, retrieval, style adaptation and shape adaptation models in Tecent Drive (https://share.weiyun.com/sI26vupw) Please put the models under 'Semantic-CariGANs/'. For testing options, please use an aligned photo image and run the below commond. Refer to 'options/test_options.py' for testing setting and details.

Given the shape and style images, please use this command:

python predict.py --name parseref_gan --input examples/photo_examples/Woody_Allen_P00002.jpg --shape examples/cari_gallery/parsing_maps_gallery/005151.png --style_path examples/style_imgs/Alan_Rickman_C00013.jpg

Given the style image, please use this command to perform retrieval, shape transformation and style translation:

python predict.py --name parseref_gan --input examples/photo_examples/Scarlett_Johansson_P00002.jpg

We follow CariFaceParsing to perform face parsing and provide the pretrain model in checkpoints/parsing.pth.

For retrieval, please go to 'Semantic-CariGANS/retrieval/' and use this command:

python train_siamese.py

For shape transformation, please go to 'Semantic-CariGANS/' and use this command:

python train.py --dataroot ./datasets/carigan/ --name parseref_gan --input_nc 10 --output_nc 10 --dataset_mode parseref --batch_size 32 --model parseref_gan

For style translation, please go to 'Semantic-CariGANS/AdaIN' and use this command:

python train.py --content_dir <content_dir> --style_dir <style_dir>

Reference

Please cite our papers if you find it useful for your research.

@article{Chu2020Learning, title={Learning to Caricature via Semantic Shape Transformation}, author={Chu, Wenqing and Hung, Wei-Chih and Tsai, Yi-Hsuan and Chang, Yu-Ting and Li, Yijun and Cai, Deng and Yang, Ming-Hsuan}, journal={arXiv preprint arXiv:2008.05090}, year={2020}, }

@inproceedings{Chu2019Weakly, title={Weakly-supervised Caricature Face Parsing through Domain Adaptation}, author={Chu, Wenqing and Hung, Wei-Chih and Tsai, Yi-Hsuan and Cai, Deng and Yang, Ming-Hsuan}, booktitle={2019 IEEE International Conference on Image Processing (ICIP)}, pages={3282--3286}, year={2019}, organization={IEEE} }

Acknowledgment

This code is heavily borrowed from

semantic-carigans's People

Contributors

wenqingchu 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.