
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
github.com/cyberagentailab/layout-dm
This repository is an official implementation of the paper titled above. Please refer to project page or paper for more details.
Here we describe the setup required for the model training and evaluation.
We check the reproducibility under this environment.
We recommend using Poetry (all settings and dependencies in pyproject.toml). Pytorch-geometry provides independent pre-build wheel for a combination of PyTorch and CUDA version (see PyG:Installation for details). If your environment does not match the one above, please update the dependencies.
curl -sSL https://install.python-poetry.org | python3 -
poetry install
wget https://github.com/CyberAgentAILab/layout-dm/releases/download/v1.0.0/layoutdm_starter.zip
unzip layoutdm_starter.zip
The data is decompressed to the following structure:
download
- clustering_weights
- datasets
- fid_weights
- pretrained_weights
Important: we find some critical errors that cannot be fixed quickly in using multiple GPUs. Please set CUDA_VISIBLE_DEVICES=<GPU_ID>
to force the model use a single GPU.
Note: our main framework is based on hydra. It is convenient to handle dozens of arguments hierarchically but may require some additional efforts if one is new to hydra.
Please run a jupyter notebook in notebooks/demo.ipynb. You can get and render the results of six layout generation tasks on two datasets (Rico and PubLayNet).
You can also train your own model from scratch, for example by
bash bin/train.sh rico25 layoutdm
, where the first and second argument specifies the dataset (choices) and the type of experiment (choices), respectively.
Note that for training/testing, style of the arguments is key=value
because we use hydra, unlike popular --key value
(e.g., argparse).
poetry run python3 -m src.trainer.trainer.test \
cond=<COND> \
job_dir=<JOB_DIR> \
result_dir=<RESULT_DIR> \
<ADDITIONAL_ARGS>
<COND>
can be: (unconditional, c, cwh, partial, refinement, relation)
For example, if you want to test the provided LayoutDM model on C->S+P
, the command is as follows:
poetry run python3 -m src.trainer.trainer.test cond=c dataset_dir=./download/datasets job_dir=./download/pretrained_weights/layoutdm_rico result_dir=tmp/dummy_results
Please refer to TestConfig for more options available. Below are some popular options for <ADDITIONAL_ARGS>
is_validation=true
: used to evaluate the generation performance on validation set instead of test set. This must be used when tuning the hyper-parameters.sampling=top_p top_p=<TOP_P>
: use top-p sampling with p=<TOP_P> instead of default sampling.poetry run python3 eval.py <RESULT_DIR>
If you find this code useful for your research, please cite our paper:
@inproceedings{inoue2023layout,
title={{LayoutDM: Discrete Diffusion Model for Controllable Layout Generation}},
author={Naoto Inoue and Kotaro Kikuchi and Edgar Simo-Serra and Mayu Otani and Kota Yamaguchi},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
year={2023},
pages={10167-10176},
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.