{"id":20663707,"url":"https://github.com/vita-group/comp4d","last_synced_at":"2025-09-07T10:36:33.160Z","repository":{"id":229570512,"uuid":"777022272","full_name":"VITA-Group/Comp4D","owner":"VITA-Group","description":"\"Comp4D: Compositional 4D Scene Generation\", Dejia Xu*, Hanwen Liang*, Neel P. Bhatt, Hezhen Hu, Hanxue Liang, Konstantinos N. Plataniotis, and Zhangyang Wang","archived":false,"fork":false,"pushed_at":"2024-08-25T05:32:35.000Z","size":63013,"stargazers_count":79,"open_issues_count":3,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-22T18:54:26.595Z","etag":null,"topics":["4d","gaussian-splatting","generative-ai","text-to-4d"],"latest_commit_sha":null,"homepage":"https://vita-group.github.io/Comp4D/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VITA-Group.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-03-25T03:12:02.000Z","updated_at":"2025-04-10T18:32:26.000Z","dependencies_parsed_at":"2025-01-09T10:14:03.389Z","dependency_job_id":"6bf161f4-98ca-4396-bfcb-9a1d5afe5cae","html_url":"https://github.com/VITA-Group/Comp4D","commit_stats":null,"previous_names":["vita-group/comp4d"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/VITA-Group/Comp4D","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VITA-Group%2FComp4D","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VITA-Group%2FComp4D/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VITA-Group%2FComp4D/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VITA-Group%2FComp4D/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VITA-Group","download_url":"https://codeload.github.com/VITA-Group/Comp4D/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VITA-Group%2FComp4D/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274026707,"owners_count":25209739,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["4d","gaussian-splatting","generative-ai","text-to-4d"],"created_at":"2024-11-16T19:19:28.925Z","updated_at":"2025-09-07T10:36:33.103Z","avatar_url":"https://github.com/VITA-Group.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Comp4D: Compositional 4D Scene Generation\n\nThe official implementation of paper \"Comp4D: Compositional 4D Scene Generation\".\n\n[[Project Page]](https://vita-group.github.io/Comp4D/) | [[Video (narrated)]](https://www.youtube.com/watch?v=9q8SV1Xf_Xw) | [[Video (results)]](https://www.youtube.com/watch?v=gXVoPTGb734) | [[Paper]](https://github.com/VITA-Group/Comp4D/blob/main/assets/Comp4D.pdf) | [[Arxiv]](https://arxiv.org/abs/2403.16993)\n\n## News\n- 2024.8.19:  Revised to support more objects.\n- 2024.4.1:  Released code!\n- 2024.3.25:  Released on arxiv!\n\n## Overview\n\n![overview](docs/static/media/task.29476c66b38120ba3c46.jpg)\n\nAs shown in the figure above, we introduce **Comp**ositional **4D** Scene Generation. Previous works concentrate on object-centric 4D objects with limited movement. In comparison, our work extends the boundaries to the demanding task of compositional 4D scene generation. We integrate GPT-4 to decompose the scene and design proper trajectories, resulting in larger-scale movements and more realistic object interactions.\n\n\u003c!-- ## Representative Results\n\n\u003ctable class=\"center\"\u003e\n  \u003ctd\u003e\u003cvideo src=\"https://github.com/VITA-Group/Comp4D/blob/main/assets/butterfly_flower1.mp4\" width=\"170\"\u003e\u003c/video\u003e\n  \u003ctd\u003e\u003cvideo src=\"https://github.com/VITA-Group/Comp4D/blob/main/assets/butterfly_flower2.mp4\" width=\"170\"\u003e\u003c/video\u003e\n  \u003ctr\u003e\n  \u003ctd\u003e\u003ca href=\"https://github.com/AILab-CVC/VideoCrafter/assets/18735168/1a57edd9-3fd2-4ce9-8313-89aca95b6ec7\"\u003e\u003cvideo src=assets/butterfly_flower1.mp4 width=\"170\"\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003ca href=\"https://github.com/AILab-CVC/VideoCrafter/assets/18735168/d671419d-ae49-4889-807e-b841aef60e8a\"\u003e\u003cvideo src=assets/butterfly_flower2.mp4 width=\"170\"\u003e\u003c/td\u003e\n  \u003ctr\u003e\n  \u003ctd style=\"text-align:center;\" width=\"170\"\u003e\"a black swan swims on the pond\"\u003c/td\u003e\n  \u003ctd style=\"text-align:center;\" width=\"170\"\u003e\"a girl is riding a horse fast on grassland\"\u003c/td\u003e\n\n\u003c/table \u003e --\u003e\n\n## Setup\n```bash\nconda env create -f environment.yml\nconda activate Comp4D\npip install -r requirements.txt\n\n# 3D Gaussian Splatting modules, skip if you already installed them\n# a modified gaussian splatting (+ depth, alpha rendering)\ngit clone --recursive https://github.com/ashawkey/diff-gaussian-rasterization\npip install ./diff-gaussian-rasterization\npip install ./simple-knn\n```\n\n## Example Case\n#### Prompt Case\n\"a butterfly flies towards the flower\"\n\n#### Compositional Scene training\n```\npython train_comp.py --configs arguments/comp_butterfly_flower_zs.py --expname butterflyflower_exp --cfg_override 100.0 --image_weight_override 0.02 --nn_weight 1000 --with_reg  --loss_dx_weight_override 0.005\n```\n--- \nWe provide a quick overview of some important arguments:  \n- `--expname`:  Experimental path.\n- `--configs`: Configuration of scene training including prompt, object identity, object scales, and trajectory. You can also use [VideoCrafter](https://github.com/AILab-CVC/VideoCrafter) in replace of Zeroscope for video-based diffusion model.\n- `--image_weight`: Weight of sds loss from image-based diffusion model.\n- `--nn_weight`: Weight of knn based rigidity loss.\n- `--loss_dx_weight`: Weight of regularization acceleration loss.\n\n\n#### Rendering\n```\npython render_comp_video.py --skip_train --configs arguments/comp_butterfly_flower_zs.py --skip_test --model_path output_demo/date/butterflyflower_exp_date/ --iteration 3000\n```\n\n\n## Static Assets Preparation\n\nWe release a set of pre-generated static assets in `data/` directory. During training, we keep the static 3D Gaussians fixed and only optimize the deformation modules. We referred to the first two stages of [4D-fy](https://github.com/sherwinbahmani/4dfy) to generate the static 3D objects. Then we convert them to point clouds (in `data/`) which are used to initialize 3D Gaussians. Thanks to the authors for sharing their awesome work!\n\n#### Example case\n```\n\n# cd /path_to_4dfy/\n\n## Stage 1\n# python launch.py --config configs/fourdfy_stage_1_low_vram.yaml --train --gpu 0 exp_root_dir=output/ seed=0 system.prompt_processor.prompt=\"a flower\"\n\n## Stage 2\n# ckpt=output/fourdfy_stage_1_low_vram/a_flower@timestamp/ckpts/last.ckpt\n# python launch.py --config configs/fourdfy_stage_2_low_vram.yaml --train --gpu 0 exp_root_dir=output/ seed=0 system.prompt_processor.prompt=\"a flower\" system.weights=$ckpt\n\n## Post-Process. Convert to mesh file.\n# python launch.py --config output/fourdfy_stage_2_low_vram/a_flower@timestamp/configs/parsed.yaml --export --gpu 0 \\\n#   resume=output/fourdfy_stage_2_low_vram/a_flower@timestamp/ckpts/last.ckpt system.exporter_type=mesh-exporter \\\n#   system.exporter.context_type=cuda system.exporter.fmt=obj\n## saved to output/fourdfy_stage_2_low_vram/a_flower@timestamp/save/iterations-export/\n\n## Convert to point cloud.\n# cd /path_to_Comp4D/\n# python mesh2ply_8w.py /path_to_4dfy/output/fourdfy_stage_2_low_vram/a_flower@timestamp/save/iterations-export/model.obj data/a_flower.ply\n```\n\n\n## Acknowledgement\n\nThis work is built on many amazing research works and open-source projects. Thanks to all the authors for sharing!\n\n- https://github.com/sherwinbahmani/4dfy\n- https://github.com/hustvl/4DGaussians\n- https://github.com/dreamgaussian/dreamgaussian\n- https://github.com/graphdeco-inria/gaussian-splatting\n- https://github.com/graphdeco-inria/diff-gaussian-rasterization\n- https://github.com/threestudio-project/threestudio\n\n## Citation\n\nIf you find this repository/work helpful in your research, please consider citing the paper and starring the repo ⭐.\n```\n@article{xu2024comp4d,\n  title={Comp4D: LLM-Guided Compositional 4D Scene Generation},\n  author={Xu, Dejia and Liang, Hanwen and Bhatt, Neel P and Hu, Hezhen and Liang, Hanxue and Plataniotis, Konstantinos N and Wang, Zhangyang},\n  journal={arXiv preprint arXiv:2403.16993},\n  year={2024}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvita-group%2Fcomp4d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvita-group%2Fcomp4d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvita-group%2Fcomp4d/lists"}