{"id":7967763,"url":"https://github.com/joeyan/gaussian_splatting","last_synced_at":"2025-07-20T15:32:04.621Z","repository":{"id":233236275,"uuid":"745697813","full_name":"joeyan/gaussian_splatting","owner":"joeyan","description":"Unofficial implementation of 3D Gaussian Splatting in PyTorch + CUDA with MIT license","archived":false,"fork":false,"pushed_at":"2024-04-24T00:42:32.000Z","size":210,"stargazers_count":89,"open_issues_count":4,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-08-08T07:30:50.621Z","etag":null,"topics":["3d-reconstruction","gaussian-splatting","novel-view-synthesis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joeyan.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-19T22:35:37.000Z","updated_at":"2024-08-02T03:07:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"f54737e5-fbd6-48c1-a1f0-bca706e99e8d","html_url":"https://github.com/joeyan/gaussian_splatting","commit_stats":null,"previous_names":["joeyan/gaussian_splatting"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeyan%2Fgaussian_splatting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeyan%2Fgaussian_splatting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeyan%2Fgaussian_splatting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeyan%2Fgaussian_splatting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joeyan","download_url":"https://codeload.github.com/joeyan/gaussian_splatting/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226809105,"owners_count":17685504,"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":["3d-reconstruction","gaussian-splatting","novel-view-synthesis"],"created_at":"2024-04-14T08:06:53.702Z","updated_at":"2024-11-27T19:30:57.296Z","avatar_url":"https://github.com/joeyan.png","language":"Python","funding_links":[],"categories":["Open Source Implementations","Tools, Pipeline \u0026 Utilities"],"sub_categories":["Unofficial Implementations","Photogrammetry \u0026 3D Scanning"],"readme":"# 3D Gaussian Splatting\nA \"from scratch\" re-implementation of [3D Gaussian Splatting\nfor Real-Time Radiance Field Rendering](https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/) by Kerbl and Kopanas et al.\n\nThis repository implements the forward and backwards passes using a PyTorch CUDA extension based on the algorithms descriped in the paper. Some details of the splatting and adaptive control algorithm are not explicitly described in the paper and there may be differences between this repo and the official implementation.\n\n## Motivation\n\n1. Provide a detailed explanation of the differential rasterization algorithm. The forward and backward pass are detailed in [MATH.md](/MATH.md)\n2. Permissive license. The original implementation does not allow commercial use and was never referenced during the development of this repository.\n3. Modular projection functions and gradient checks allow for easier experimentation with camera/pose gradients, new camera models etc. \n4. Minimal dependencies.\n\nIf there are any issues/errors please open an Issue or Pull Request!\n\n## Performance\n\nEvaluations done with the Mip-NeRF 360 dataset at ~1 megapixel resoloution. This corresponds to the 2x downsampled indoor scenes and 4x downsampled outdoor scenes. Every 8th image was used for the test split. Here are some comparisons with the with the official Inria implementation (copied from \"Per-Scene Error Metrics\").\n\n\n| Method    | Dataset     | PSNR | SSIM | N Gaussians | Train Duration   |\n|-----------|-------------|------|------|-------------|------------------|\n| Inria-30k | Garden 1/4x | 27.41| 0.87 |             |                  |\n| Ours-30k  | Garden 1/4x | 27.05| 0.85 | 2.86M       | 20:18  (RTX4090) |\n| Inria-7k  | Garden 1/4x | 26.24| 0.83 |             |                  |\n| Ours-7k   | Garden 1/4x | 25.83| 0.80 | 1.52M       | 3:05   (RTX4090) |\n| Inria-30k | Counter 1/2x| 28.70| 0.91 |             |                  |\n| Ours-30k  | Counter 1/2x| 28.75| 0.90 | 1.84M       | 23:37  (RTX4090) |\n| Inria-7k  | Counter 1/2x| 26.70| 0.87 |             |                  |\n| Ours-7k   | Counter 1/2x| 27.59| 0.89 | 1.37M       | 4:10   (RTX4090) |\n| Inria-30k | Bonsai  1/2x| 31.98| 0.94 |             |                  |\n| Ours-30k  | Bonsai  1/2x| 32.21| 0.95 | 2.85M       | 27:22  (RTX4090) |\n| Inria-7k  | Bonsai 1/2x | 28.85| 0.91 |             |                  |\n| Ours-7k   | Bonsai 1/2x | 30.42| 0.93 | 1.86M       | 4:19   (RTX4090) |\n| Inria-30k | Room 1/2x   | 30.63| 0.91 |             |                  |\n| Ours-30k  | Room 1/2x   | 31.73| 0.93 | 1.53M       | 20:13  (RTX4090) |\n| Inria-7k  | Room 1/2x   | 28.14| 0.88 |             |                  |\n| Ours-7k   | Room 1/2x   | 30.30| 0.91 | 1.01M       | 3:17   (RTX4090) |\n\n\nA comparison from one of the test images in the `garden` dataset. The official implementation and ground truth images appear to be more saturated since they are screen captures of the pdf.\n\nOurs - 30k:\n![image](https://github.com/joeyan/gaussian_splatting/assets/17635504/519a5f04-82f3-4291-b063-c122efd22c19)\n\nOfficial Inria implementation - 30k:\n![image](https://github.com/joeyan/gaussian_splatting/assets/17635504/1460b7eb-a28c-43ed-b8e2-a2695f6ab805)\n\nGround truth:\n![image](https://github.com/joeyan/gaussian_splatting/assets/17635504/e3c1f0c2-3f36-41dc-8441-df856399e987)\n\n\n## Installation\nThis package requires CUDA which can be installed from [here](https://developer.nvidia.com/cuda-downloads). \n\n1. Install Python dependencies\n```\npip install -r requirements.txt\n```\n\n2. Install the PyTorch CUDA extension\n```\npython setup.py build_ext \u0026\u0026 python setup.py install\n```\nNote:\n- Windows systems may need modify compilation flags in `setup.py`\n\nOptional:\nThis project uses `clang-format` to lint the C++/CUDA files:\n\n```\nsudo apt install clang-format\n```\nRunning `lint.sh` will run both `black` and `clang-format`.\n\n\n## Training on Mip-Nerf 360 Scenes\n\n1. Download the [Mip-NeRF 360](https://jonbarron.info/mipnerf360/) dataset and unzip\n\n```\nwget http://storage.googleapis.com/gresearch/refraw360/360_v2.zip \u0026\u0026 unzip 360_v2.zip\n```\n\n\n2. Run the training script:\n```\npython colmap_splat.py 7k --dataset_path \u003cpath to dataset\u003e --downsample_factor 4\n``` \n\nTo run the high-quality version use `30k` instead of `7k` The `dataset_path` argument refers to the top-level folder for each dataset (`garden`, `kitchen` etc). The paper uses `--downsample_factor 4` for the outdoor scenes and `--downsample_factor 2` for the indoor scenes.\n\n\nFor more options:\n```\npython colmap_splat.py 7k --help\n```\n\nTo run all unit tests:\n\n```\npython -m unittest discover test\n```\n\n## References\n\nThe original paper:\n```\n@Article{kerbl3Dgaussians,\n      author = {Kerbl, Bernhard and Kopanas, Georgios and Leimk{\\\"u}hler, Thomas and Drettakis, George},\n      title = {3D Gaussian Splatting for Real-Time Radiance Field Rendering},\n      journal = {ACM Transactions on Graphics},\n      number = {4},\n      volume = {42},\n      month = {July},\n      year = {2023},\n      url= {https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/}\n}\n```\n\nThe EWA Splatting approach that is the basis for 3D Gaussian Splatting:\n```\n@Article{zwicker2002ewa,\n    author={M. Zwicker and H. Pfister and J. van Baar and M. Gross},\n    title={EWA Splatting},\n    journal={IEEE Transactions on Visualization and Computer Graphics},\n    number={3},\n    volume={8},\n    month={July},\n    year={2002},\n    publisher={IEEE},\n    url={https://www.cs.umd.edu/~zwicker/publications/EWASplatting-TVCG02.pdf}\n}\n```\n\n`gsplat` [Mathematical Supplement](https://arxiv.org/abs/2312.02121)\n```\n@misc{ye2023mathematical,\n    title={Mathematical Supplement for the $\\texttt{gsplat}$ Library}, \n    author={Vickie Ye and Angjoo Kanazawa},\n    year={2023},\n    eprint={2312.02121},\n    archivePrefix={arXiv},\n    primaryClass={cs.MS}\n}\n```\n\nA great reference for matrix derivatives:\n```\n@misc{giles2008extended,\n    title={An extended collection of matrix derivative results for forward and reverse mode algorithmic differentiation}, \n    author={Mike Giles},\n    month={January}\n    year={2008},\n    url={https://people.maths.ox.ac.uk/gilesm/files/NA-08-01.pdf}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeyan%2Fgaussian_splatting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoeyan%2Fgaussian_splatting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeyan%2Fgaussian_splatting/lists"}