{"id":18001763,"url":"https://wix-incubator.github.io/DLT/","last_synced_at":"2025-03-26T08:30:59.881Z","repository":{"id":187216182,"uuid":"676510184","full_name":"wix-incubator/DLT","owner":"wix-incubator","description":"Diffusion Layout Transformer implementation.","archived":false,"fork":false,"pushed_at":"2023-08-29T10:36:57.000Z","size":3992,"stargazers_count":57,"open_issues_count":2,"forks_count":4,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-03-24T22:34:34.806Z","etag":null,"topics":["continous-diffusion","ddpm","diffusion","discrete-diffusion","generative-ai","generative-models","iccv2023","layout-generation","layouts","magazine","publaynet","rico","web-design"],"latest_commit_sha":null,"homepage":"https://wix-incubator.github.io/DLT/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wix-incubator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-08-09T11:12:19.000Z","updated_at":"2025-03-19T07:57:34.000Z","dependencies_parsed_at":"2024-01-18T22:39:59.745Z","dependency_job_id":"2b3807aa-fd07-40fb-a03d-f5eb70d36fef","html_url":"https://github.com/wix-incubator/DLT","commit_stats":null,"previous_names":["wix-incubator/dlt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wix-incubator%2FDLT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wix-incubator%2FDLT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wix-incubator%2FDLT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wix-incubator%2FDLT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wix-incubator","download_url":"https://codeload.github.com/wix-incubator/DLT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245618615,"owners_count":20645032,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["continous-diffusion","ddpm","diffusion","discrete-diffusion","generative-ai","generative-models","iccv2023","layout-generation","layouts","magazine","publaynet","rico","web-design"],"created_at":"2024-10-29T23:18:45.153Z","updated_at":"2025-03-26T08:30:59.490Z","avatar_url":"https://github.com/wix-incubator.png","language":"Python","funding_links":[],"categories":["2023"],"sub_categories":[],"readme":"# \u003cp style=\"text-align: center;\"\u003e[ICCV 23] DLT: Conditioned layout generation with Joint Discrete-Continuous Diffusion Layout Transformer\u003c/p\u003e\n\nThis repository is an official implementation of DLT paper. Please, refer to the [paper](https://arxiv.org/abs/2110.00000) \nfor more details and [project page](https://wix-incubator.github.io/DLT/) for general overview.\u003cdiv style=\"display: flex; flex-direction: column; align-items: center;\"\u003e\n\n| Unconditional                              | Category                          | Category + Size                       |\n|--------------------------------------------|-----------------------------------|---------------------------------------|\n| ![unconditional](./imgs/unconditional.gif) | ![category](./imgs/whole_box.gif) | ![category_size](./imgs/location.gif) |\n\n\n### Dev environment\n- Operating System: Ubuntu 18.04\n- CUDA Version: 11.6\n- Python Version: 3.9\n### Requirements\nAll relevant requirements are listed in [environment.yml](environment.yml). We recommend using \n[conda](https://docs.conda.io/en/latest/) to create the appropriate environment and install the dependencies:\n```bash\nconda env create -f environment.yml\nconda activate dlt\n```\n### Datasets\nPlease download the public datasets at the following webpages. Put it in your folder and update \n`./dlt/configs/remote/dataset_config.yaml` accordingly.\n\n1. [RICO](https://interactionmining.org/rico)\n2. [PubLayNet](https://github.com/ibm-aur-nlp/PubLayNet)\n3. [Magazine](https://xtqiao.com/projects/content_aware_layout/)\n\n### Training\nYou can train the model using any config script in [configs](./dlt/configs) folder. For example, if you want to train the \nprovided DLT model on publaynet dataset, the command is as follows:\n\n```bash\ncd dlt\npython main.py --config configs/remote/dlt_publaynet_config.yaml --workdir \u003cWORKDIR\u003e\n```\nPlease, see that code is accelerator agnostic. if you don't want to log results to wandb, just set `--workdir test` \nin args.\n\n### Evaluation\n\nTo generate samples for evaluation on the test set, follow these steps:\n\n- train the model using the above command\n- Run the following command:\n\n```bash\n# put weights in config.logs folder\nDATASET = \"publaynet\" # or \"rico\" or \"magazine\"\npython generate_samples.py --config configs/remote/dlt_{$DATASET}_config.yaml \\\\\n                           --workdir \u003cWORKDIR\u003e --epoch \u003cEPOCH\u003e --cond_type \u003cCOND_TYPE\u003e \\\\\n                           --save True\n# get all the metrics \n# update path to pickle file in dlt/evaluation/metric_comp.py\n./download_fid_model.sh\npython metric_comp.py\n```\nwhere `\u003cCOND_TYPE\u003e` can be: (all, whole_box, loc) - (unconditional, category, category+size) respectively,\n`\u003cEPOCH\u003e` is the epoch number of the model you want to evaluate, and `\u003cWORKDIR\u003e` is the path to the folder where\nthe model weights are saved (e.g. rico_final). The generated samples will be saved in `logs/\u003cWORKDIR\u003e/samples` folder if `save` True.\n\nAn output from it is pickle file with generated samples. You can use it to calculate metrics.\n\nThe folder with weights after training has this structure:\n```\nlogs\n├── magazine_final\n│   ├── checkpoints\n│   └── samples\n├── publaynet_final\n│   ├── checkpoints\n│   └── samples\n└── rico_final\n    ├── checkpoints\n    └── samples\n```\n\n## Citation\n\nIf you find this code useful for your research, please cite our paper:\n\n```\n@misc{levi2023dlt,\n      title={DLT: Conditioned layout generation with Joint Discrete-Continuous Diffusion Layout Transformer},\n      author={Elad Levi and Eli Brosh and Mykola Mykhailych and Meir Perez},\n      year={2023},\n      eprint={2303.03755},\n      archivePrefix={arXiv},\n      primaryClass={cs.CV}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/wix-incubator.github.io%2FDLT%2F","html_url":"https://awesome.ecosyste.ms/projects/wix-incubator.github.io%2FDLT%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/wix-incubator.github.io%2FDLT%2F/lists"}