Git Product home page Git Product logo

lagan'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/. If not availvale, please give me your emali in Issues. or link: https://pan.baidu.com/s/1vhJKsrGdffg2kS2oWo5EHg?pwd=9xyf password: 9xyf; or link: https://pan.bnu.edu.cn/l/n1Hd8o

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{chao2022lagan,
  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)},
  pages={137--151},
  year={2022},
  organization={Springer}
}

Acknowledgements

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

lagan's People

Contributors

chaowentao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hanask

lagan's Issues

sketches.zip已损坏

您好,我发现您提供的sketches.zip下载后是已损坏的文件,请您确认一下是否上传有误?谢谢!

[LFS error] Help with getting data

git-lfs fetch sketches.zip

fetch: Fetching reference refs/heads/main batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access. error: failed to fetch some objects from 'https://github.com/chaowentao/LAGAN.git/info/lfs'

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.