Giter Club home page Giter Club logo

desigen's Introduction

Desigen: A Pipeline for Controllable Design Template Generation [CVPR'24]

Requirement

  1. Create a conda enviroment:
conda env create -n desigen python=3.8
conda activate desigen
pip install -r requirements.txt
  1. Download Bastnet checkpoint into saliency folder.
  1. Download meta data from here.

  2. Download and process background images.

  3. Preprocess saliency map for background images.

  4. Move the corresponding background images to the right directory.

Background Generation

Training

cd background/
# config accelerate first
accelerate config
# train the background generator
sh train.sh

More training settings can refer to Diffusers.

Evaluation

Generate background images with the prompts on validation set and evaluate them by the proposed metrics: FID, Salient Ratio and CLIP Score.

The pretrained saliency dectection mode can be download on Basnet and placed on salliency directory.

sh test.sh

Layout Generation

Training

cd layout/
sh train.sh

Evaluation

Compute the layout given ground truth images and save them for further evaluation.

sh test.sh

Pipeline Inference

Designs can be simply generated by the following command:

python pipeline.py \
--prompt "Rose Valentines' Day" \
--mode "background" \
--encoder_path /path/to/encoder \
--decoder_path /path/to/decoder \
--generator_path logs/background-ours

The mode parameter can also be swiched to background (background-only generation), design (design generation) or iteration (iterative refine). A user-input attention reduction mask is also allowed by mask_image_path.

Acknowledgements

Part of our code is borrowed from the following repositories:

  1. Huggingface Diffusers
  2. Layout Trasformer
  3. Basnet

Citation

@misc{weng2024desigen,
      title={Desigen: A Pipeline for Controllable Design Template Generation}, 
      author={Haohan Weng and Danqing Huang and Yu Qiao and Zheng Hu and Chin-Yew Lin and Tong Zhang and C. L. Philip Chen},
      year={2024},
      eprint={2403.09093},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

desigen's People

Contributors

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