Git Product home page Git Product logo

facegan's Introduction

LAGAN

Pytorch implementation for (PRCV 2022) LAGAN: Landmark Aided Text to Face Sketch Generation.

Overview

Data

TextCUFSF dataset has been included in data/sketches/

Training

All code was developed and tested on Ubuntu 16.04 with Python 3.7 (Anaconda) and PyTorch 1.1.

DAMSM model includes text encoder and image encoder

  • Pre-train DAMSM model for TextCUFSF dataset:
python pretrain_DAMSM.py --cfg cfg/DAMSM/sketches_18_4.yml --gpu 0

LAGAN model

  • Train LAGAN model for TextCUFSF dataset:
python main.py --cfg cfg/train_sketch_18_4.yml --gpu 1

*.yml files include configuration for training and testing.

Testing

  • Test LAGAN model for bird dataset:
python main.py --cfg cfg/eval_sketch_18_4.yml --gpu 2

Examples generated by LAGAN

Code Structure

  • code/main.py: the entry point for training and testing.
  • code/trainer_mutual_self.py: creates the main networks, harnesses and reports the progress of training.
  • code/model.py: defines the architecture of LAGAN.
  • code/attention.py: defines the spatial and channel-wise attentions.
  • code/VGGFeatureLoss.py: defines the architecture of the VGG-16.
  • code/datasets.py: defines the class for loading images and captions.
  • code/pretrain_DAMSM.py: creates the text and image encoders, harnesses and reports the progress of training.
  • code/miscc/losses.py: defines and computes the losses.
  • code/miscc/config.py: creates the option list.
  • code/miscc/utils.py: additional functions.

Citiation

If you find this work helpful, please consider citing:

@inproceedings{LAGAN,
  title={LAGAN: Landmark Aided Text to Face Sketch Generation},
  author={Chao, Wentao and Chang, Liang and Xi, Fangfang and Duan, Fuqing},
  booktitle={Chinese Conference on Pattern Recognition and Computer Vision (PRCV)},
  year={2022},
  organization={Springer}
}

Acknowledgements

This code borrows heavily from ControlGAN repository. Thanks a lot.

facegan's People

Contributors

chaowentao avatar karelbondan avatar

Stargazers

 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.