Skip to main content

No project description provided

Project description

LayoutPrompter: Awaken the Design Ability of Large Language Models (NeurIPS2023)

LayoutPrompter

LayoutPrompter is a versatile method for graphic layout generation, capable of solving various conditional layout generation tasks (as illustrated on the left side) across a range of layout domains (as illustrated on the right side) without any model training or fine-tuning.

Installation

pip install git+https://github.com/creative-graphic-design/layout-prompter

Results

We conduct experiments on three groups of layout generation tasks, including

  • constraint-explicit layout generation
  • content-aware layout generation
  • text-to-layout

Below are the qualitative results.

Constraint-Explicit Layout Generation

constraint-explicit

Content-Aware Layout Generation

content-aware

Text-to-Layout

text2layout

Installation

  1. Clone this repository
git clone https://github.com/microsoft/LayoutGeneration.git
cd LayoutGeneration/LayoutPrompter
  1. Create a conda environment
conda create -n layoutprompter python=3.8
conda activate layoutprompter
  1. Install PyTorch and other dependencies
conda install pytorch=1.13.1 torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
pip install -r requirements.txt
pip install -e src/

Datasets

We use 4 datasets in this work, including RICO, PubLayNet, PosterLayout and WebUI. They can be downloaded from HuggingFace using the following commands:

git lfs install
git clone https://huggingface.co/datasets/KyleLin/LayoutPrompter

Move the contents to the dataset directory as follows:

dataset/
├── posterlayout
├── publaynet
├── rico
├── webui

Notebooks

We include three jupyter notebooks here, each corresponding to a type of layout generation task. They all consist of the following components:

  • Configuration
  • Process raw data
  • Dynamic exemplar selection
  • Input-output serialization
  • Call GPT
  • Parsing
  • Layout ranking
  • Visualization

Try it!

Citation

If you find this code useful for your research, please cite our paper:

@inproceedings{lin2023layoutprompter,
  title={LayoutPrompter: Awaken the Design Ability of Large Language Models},
  author={Lin, Jiawei and Guo, Jiaqi and Sun, Shizhao and Yang, Zijiang James and Lou, Jian-Guang and Zhang, Dongmei},
  booktitle={Thirty-seventh Conference on Neural Information Processing Systems},
  year={2023}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

layout_prompter-0.1.0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

layout_prompter-0.1.0-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

Details for the file layout_prompter-0.1.0.tar.gz.

File metadata

  • Download URL: layout_prompter-0.1.0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1022-azure

File hashes

Hashes for layout_prompter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fe567afb4aaef286d0c5f1a689ebbdf363251d21d41665f14af7b11fac46b1b2
MD5 e0b055f354b4a55a76186c6691163950
BLAKE2b-256 8cd15e1491888696041638f483412b5883dbfb4daf4aad623accd7243826a059

See more details on using hashes here.

File details

Details for the file layout_prompter-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: layout_prompter-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1022-azure

File hashes

Hashes for layout_prompter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a041a69c2543d2fa46e09a684b373fe92af42f92dbc8fa65d8aab5a8a076fd7
MD5 4043342dcb0b71588c6541885812583e
BLAKE2b-256 fcbbd78ba19dff475c07d19f1e36ce98a685cdada14bc4b05998e3a055482830

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page