{"id":29009877,"url":"https://github.com/tencentarc/di-pcg","last_synced_at":"2025-06-25T15:33:36.942Z","repository":{"id":268974914,"uuid":"905548255","full_name":"TencentARC/DI-PCG","owner":"TencentARC","description":"Code release of our paper \"DI-PCG: Diffusion-based Efficient Inverse Procedural Content Generation for High-quality 3D Asset Creation\".","archived":false,"fork":false,"pushed_at":"2025-01-21T07:09:43.000Z","size":3109,"stargazers_count":74,"open_issues_count":1,"forks_count":3,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-01-21T08:19:59.145Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TencentARC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-19T03:54:49.000Z","updated_at":"2025-01-21T07:09:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"220b6c42-dae1-404d-ab7b-15c5c205ef75","html_url":"https://github.com/TencentARC/DI-PCG","commit_stats":null,"previous_names":["tencentarc/di-pcg"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TencentARC/DI-PCG","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentARC%2FDI-PCG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentARC%2FDI-PCG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentARC%2FDI-PCG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentARC%2FDI-PCG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TencentARC","download_url":"https://codeload.github.com/TencentARC/DI-PCG/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentARC%2FDI-PCG/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261901405,"owners_count":23227593,"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":[],"created_at":"2025-06-25T15:33:25.224Z","updated_at":"2025-06-25T15:33:36.933Z","avatar_url":"https://github.com/TencentARC.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \n# DI-PCG: Diffusion-based Efficient Inverse Procedural Content Generation for High-quality 3D Asset Creation\n\n\u003ca href=\"https://thuzhaowang.github.io/projects/DI-PCG\"\u003e\u003cimg src=\"https://img.shields.io/static/v1?label=Project%20Page\u0026message=Github\u0026color=blue\u0026logo=github-pages\"\u003e\u003c/a\u003e\u0026ensp;\u003ca href=\"http://arxiv.org/abs/2412.15200\"\u003e\u003cimg src=\"https://img.shields.io/badge/ArXiv-2412.15200-brightgreen\"\u003e\u003c/a\u003e\u0026ensp;\u003ca href=\"https://huggingface.co/TencentARC/DI-PCG\"\u003e\u003cimg src=\"https://img.shields.io/badge/%F0%9F%A4%97%20Model_Card-Huggingface-orange\"\u003e\u003c/a\u003e\u0026ensp;\u003ca href=\"https://huggingface.co/spaces/TencentARC/DI-PCG\"\u003e\u003cimg src=\"https://img.shields.io/badge/%F0%9F%A4%97%20Gradio%20Demo-Huggingface-orange\"\u003e\u003c/a\u003e\u003cbr\u003e\n\n**[Wang Zhao\u003csup\u003e1\u003c/sup\u003e](https://thuzhaowang.github.io), [Yan-Pei Cao\u003csup\u003e2\u003c/sup\u003e](https://yanpei.me/), [Jiale Xu\u003csup\u003e1\u003c/sup\u003e](https://bluestyle97.github.io/),  [Yuejiang Dong\u003csup\u003e1,3\u003c/sup\u003e](https://scholar.google.com.hk/citations?user=0i7bPj8AAAAJ\u0026hl=zh-CN), [Ying Shan\u003csup\u003e1\u003c/sup\u003e](https://scholar.google.com/citations?user=4oXBp9UAAAAJ\u0026hl=en)**\n\n\u003csup\u003e1\u003c/sup\u003eARC Lab, Tencent PCG \u0026ensp;\u0026ensp;\u003csup\u003e2\u003c/sup\u003eVAST \u0026ensp;\u0026ensp;\u003csup\u003e3\u003c/sup\u003eTsinghua University\n\n\n**CVPR 2025**\n\n\u003c/div\u003e\n\n---\n\n## 🚩 Overview\nThis repository contains code release for our CVPR 2025 paper \"DI-PCG: Diffusion-based Efficient Inverse Procedural Content Generation for High-quality 3D Asset Creation\".\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"misc/teaser.png\" \u003e\n\u003c/p\u003e\n\n\n## ⚙️ Installation\nFirst clone this repository:\n```\ngit clone https://github.com/TencentARC/DI-PCG.git\ncd DI-PCG\n```\nWe recommend using anaconda to install the dependencies:\n```\nconda create -n di-pcg python=3.10.14\nconda activate di-pcg\nconda install pytorch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0  pytorch-cuda=11.8 -c pytorch -c nvidia\npip install -r requirements.txt\n```\n\n## 🚀 Usage\nFor a quick start, try the huggingface gradio demo [here](https://huggingface.co/spaces/TencentARC/DI-PCG).\n\n### Download models\nWe provide the pretrained diffusion models for chair, vase, table, basket, flower and dandelion. You can download them from [model card](https://huggingface.co/TencentARC/DI-PCG) and put them in `./pretrained_models/`. \n\nAlternatively, the inference script will automatically download the pretrained models for you.\n\n### Local gradio demo\nTo run the gradio demo locally, run:\n```\npython app.py\n```\n\n### Inference\nTo run the inference demo, simply use:\n```\npython ./scripts/sample_diffusion.py --config ./configs/demo/chair_demo.yaml\n```\nThis script processes all the chair images in the `./examples/chair` folder and saves the generated 3D models and their rendered images in `./logs`. \n\nTo generate other categories, use the corresponding YAML config file such as `vase_demo.yaml`. Currently we supprt `chair`, `table`, `vase`, `basket`, `flower` and `dandelion` generators developped by [Infinigen](https://github.com/princeton-vl/infinigen).\n```\npython ./scripts/sample_diffusion.py --config ./configs/demo/vase_demo.yaml\n```\n\n### Training\nWe train a diffusion model for each procedural generator. The training data is generated by randomly sampling the PCG and render multi-view images. To prepare the training data, run:\n```\npython ./scripts/prepare_data.py --generator ChairFactory --save_root /path/to/save/training/data\n```\nReplace `ChairFactory` with other category options as detailed in the `./scripts/prepare_data.py` file. This script also conducts offline augmentation and saves the extracted DINOv2 features for each image, which may consume a lot of disk storage. You can adjust the number of the generated data and the render configurations accordingly.\n\nAfter generating the training data, start the training by:\n```\npython ./scripts/train_diffusion.py --config ./configs/train/chair_train.yaml\n```\n\n### Use your own PCG\nDI-PCG is general for any procedural generator. To train a diffusion model for your PCG, see `./docs/` for detailed instructions.\n\nIf you have any question, feel free to open an issue or contact us.\n\n## :books: Citation\n\nIf you find our work useful for your research or applications, please cite using this BibTeX:\n\n```BibTeX\n@article{zhao2024dipcg,\n  title={DI-PCG: Diffusion-based Efficient Inverse Procedural Content Generation for High-quality 3D Asset Creation},\n  author={Zhao, Wang and Cao, Yanpei and Xu, Jiale and Dong, Yuejiang and Shan, Ying},\n  journal={arXiv preprint arXiv:2412.15200},\n  year={2024}\n}\n```\n\n## 🤗 Acknowledgements\n\nDI-PCG is built on top of some awesome open-source projects: [Infinigen](https://github.com/princeton-vl/infinigen), [Fast-DiT](https://github.com/chuanyangjin/fast-DiT). We sincerely thank them all.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftencentarc%2Fdi-pcg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftencentarc%2Fdi-pcg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftencentarc%2Fdi-pcg/lists"}