Model card and the original license
Browse filesFiles changed (3)
- LICENSEAdded+52
- LICENSE-SAM.txtAdded+52
- README.mdAdded+420
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152SAM LicenseLast Updated: November 19, 2025
“Agreement” means the terms and conditions for use, reproduction, distribution and modification of the SAM Materials set forth herein.
“SAM Materials” means, collectively, Documentation and the models, software and algorithms, including machine-learning model code, trained model weights, inference-enabling code, training-enabling code, fine-tuning enabling code, and other elements of the foregoing distributed by Meta and made available under this Agreement.
“Documentation” means the specifications, manuals and documentation accompanying SAM Materials distributed by Meta.
“Licensee” or “you” means you, or your employer or any other person or entity (if you are entering into this Agreement on such person or entity’s behalf), of the age required under applicable laws, rules or regulations to provide legal consent and that has legal authority to bind your employer or such other person or entity if you are entering in this Agreement on their behalf.
“Meta” or “we” means Meta Platforms Ireland Limited (if you are located in or, if you are an entity, your principal place of business is in the EEA or Switzerland) or Meta Platforms, Inc. (if you are located outside of the EEA or Switzerland).
“Sanctions” means any economic or trade sanctions or restrictions administered or enforced by the United States (including the Office of Foreign Assets Control of the U.S. Department of the Treasury (“OFAC”), the U.S. Department of State and the U.S. Department of Commerce), the United Nations, the European Union, or the United Kingdom.
“Trade Controls” means any of the following: Sanctions and applicable export and import controls.
By using or distributing any portion or element of the SAM Materials, you agree to be bound by this Agreement.
1. License Rights and Redistribution.
a. Grant of Rights. You are granted a non-exclusive, worldwide, non-transferable and royalty-free limited license under Meta’s intellectual property or other rights owned by Meta embodied in the SAM Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the SAM Materials.
i. Grant of Patent License. Subject to the terms and conditions of this License, you are granted a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by Meta that are necessarily infringed alone or by combination of their contribution(s) with the SAM 3 Materials. If you institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the SAM 3 Materials incorporated within the work constitutes direct or contributory patent infringement, then any patent licenses granted to you under this License for that work shall terminate as of the date such litigation is filed. b. Redistribution and Use.
i. Distribution of SAM Materials, and any derivative works thereof, are subject to the terms of this Agreement. If you distribute or make the SAM Materials, or any derivative works thereof, available to a third party, you may only do so under the terms of this Agreement and you shall provide a copy of this Agreement with any such SAM Materials.
ii. If you submit for publication the results of research you perform on, using, or otherwise in connection with SAM Materials, you must acknowledge the use of SAM Materials in your publication.
iii. Your use of the SAM Materials must comply with applicable laws and regulations, including Trade Control Laws and applicable privacy and data protection laws.iv. Your use of the SAM Materials will not involve or encourage others to reverse engineer, decompile or discover the underlying components of the SAM Materials.v. You are not the target of Trade Controls and your use of SAM Materials must comply with Trade Controls. You agree not to use, or permit others to use, SAM Materials for any activities subject to the International Traffic in Arms Regulations (ITAR) or end uses prohibited by Trade Controls, including those related to military or warfare purposes, nuclear industries or applications, espionage, or the development or use of guns or illegal weapons.2. User Support. Your use of the SAM Materials is done at your own discretion; Meta does not process any information nor provide any service in relation to such use. Meta is under no obligation to provide any support services for the SAM Materials. Any support provided is “as is”, “with all faults”, and without warranty of any kind.
3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE SAM MATERIALS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OF ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF ANY KIND, BOTH EXPRESS AND IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE SAM MATERIALS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE SAM MATERIALS AND ANY OUTPUT AND RESULTS. 4. Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY DIRECT OR INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY OF THE FOREGOING. 5. Intellectual Property.
a. Subject to Meta’s ownership of SAM Materials and derivatives made by or for Meta, with respect to any derivative works and modifications of the SAM Materials that are made by you, as between you and Meta, you are and will be the owner of such derivative works and modifications. b. If you institute litigation or other proceedings against Meta or any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the SAM Materials, outputs or results, or any portion of any of the foregoing, constitutes infringement of intellectual property or other rights owned or licensable by you, then any licenses granted to you under this Agreement shall terminate as of the date such litigation or claim is filed or instituted. You will indemnify and hold harmless Meta from and against any claim by any third party arising out of or related to your use or distribution of the SAM Materials. 6. Term and Termination. The term of this Agreement will commence upon your acceptance of this Agreement or access to the SAM Materials and will continue in full force and effect until terminated in accordance with the terms and conditions herein. Meta may terminate this Agreement if you are in breach of any term or condition of this Agreement. Upon termination of this Agreement, you shall delete and cease use of the SAM Materials. Sections 3, 4 and 7 shall survive the termination of this Agreement. 7. Governing Law and Jurisdiction. This Agreement will be governed and construed under the laws of the State of California without regard to choice of law principles, and the UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement. The courts of California shall have exclusive jurisdiction of any dispute arising out of this Agreement.
8. Modifications and Amendments. Meta may modify this Agreement from time to time; provided that they are similar in spirit to the current version of the Agreement, but may differ in detail to address new problems or concerns. All such changes will be effective immediately. Your continued use of the SAM Materials after any modification to this Agreement constitutes your agreement to such modification. Except as provided in this Agreement, no modification or addition to any provision of this Agreement will be binding unless it is in writing and signed by an authorized representative of both you and Meta.12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152SAM LicenseLast Updated: November 19, 2025
“Agreement” means the terms and conditions for use, reproduction, distribution and modification of the SAM Materials set forth herein.
“SAM Materials” means, collectively, Documentation and the models, software and algorithms, including machine-learning model code, trained model weights, inference-enabling code, training-enabling code, fine-tuning enabling code, and other elements of the foregoing distributed by Meta and made available under this Agreement.
“Documentation” means the specifications, manuals and documentation accompanying SAM Materials distributed by Meta.
“Licensee” or “you” means you, or your employer or any other person or entity (if you are entering into this Agreement on such person or entity’s behalf), of the age required under applicable laws, rules or regulations to provide legal consent and that has legal authority to bind your employer or such other person or entity if you are entering in this Agreement on their behalf.
“Meta” or “we” means Meta Platforms Ireland Limited (if you are located in or, if you are an entity, your principal place of business is in the EEA or Switzerland) or Meta Platforms, Inc. (if you are located outside of the EEA or Switzerland).
“Sanctions” means any economic or trade sanctions or restrictions administered or enforced by the United States (including the Office of Foreign Assets Control of the U.S. Department of the Treasury (“OFAC”), the U.S. Department of State and the U.S. Department of Commerce), the United Nations, the European Union, or the United Kingdom.
“Trade Controls” means any of the following: Sanctions and applicable export and import controls.
By using or distributing any portion or element of the SAM Materials, you agree to be bound by this Agreement.
1. License Rights and Redistribution.
a. Grant of Rights. You are granted a non-exclusive, worldwide, non-transferable and royalty-free limited license under Meta’s intellectual property or other rights owned by Meta embodied in the SAM Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the SAM Materials.
i. Grant of Patent License. Subject to the terms and conditions of this License, you are granted a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by Meta that are necessarily infringed alone or by combination of their contribution(s) with the SAM 3 Materials. If you institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the SAM 3 Materials incorporated within the work constitutes direct or contributory patent infringement, then any patent licenses granted to you under this License for that work shall terminate as of the date such litigation is filed. b. Redistribution and Use.
i. Distribution of SAM Materials, and any derivative works thereof, are subject to the terms of this Agreement. If you distribute or make the SAM Materials, or any derivative works thereof, available to a third party, you may only do so under the terms of this Agreement and you shall provide a copy of this Agreement with any such SAM Materials.
ii. If you submit for publication the results of research you perform on, using, or otherwise in connection with SAM Materials, you must acknowledge the use of SAM Materials in your publication.
iii. Your use of the SAM Materials must comply with applicable laws and regulations, including Trade Control Laws and applicable privacy and data protection laws.iv. Your use of the SAM Materials will not involve or encourage others to reverse engineer, decompile or discover the underlying components of the SAM Materials.v. You are not the target of Trade Controls and your use of SAM Materials must comply with Trade Controls. You agree not to use, or permit others to use, SAM Materials for any activities subject to the International Traffic in Arms Regulations (ITAR) or end uses prohibited by Trade Controls, including those related to military or warfare purposes, nuclear industries or applications, espionage, or the development or use of guns or illegal weapons.2. User Support. Your use of the SAM Materials is done at your own discretion; Meta does not process any information nor provide any service in relation to such use. Meta is under no obligation to provide any support services for the SAM Materials. Any support provided is “as is”, “with all faults”, and without warranty of any kind.
3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE SAM MATERIALS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OF ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF ANY KIND, BOTH EXPRESS AND IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE SAM MATERIALS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE SAM MATERIALS AND ANY OUTPUT AND RESULTS. 4. Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY DIRECT OR INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY OF THE FOREGOING. 5. Intellectual Property.
a. Subject to Meta’s ownership of SAM Materials and derivatives made by or for Meta, with respect to any derivative works and modifications of the SAM Materials that are made by you, as between you and Meta, you are and will be the owner of such derivative works and modifications. b. If you institute litigation or other proceedings against Meta or any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the SAM Materials, outputs or results, or any portion of any of the foregoing, constitutes infringement of intellectual property or other rights owned or licensable by you, then any licenses granted to you under this Agreement shall terminate as of the date such litigation or claim is filed or instituted. You will indemnify and hold harmless Meta from and against any claim by any third party arising out of or related to your use or distribution of the SAM Materials. 6. Term and Termination. The term of this Agreement will commence upon your acceptance of this Agreement or access to the SAM Materials and will continue in full force and effect until terminated in accordance with the terms and conditions herein. Meta may terminate this Agreement if you are in breach of any term or condition of this Agreement. Upon termination of this Agreement, you shall delete and cease use of the SAM Materials. Sections 3, 4 and 7 shall survive the termination of this Agreement. 7. Governing Law and Jurisdiction. This Agreement will be governed and construed under the laws of the State of California without regard to choice of law principles, and the UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement. The courts of California shall have exclusive jurisdiction of any dispute arising out of this Agreement.
8. Modifications and Amendments. Meta may modify this Agreement from time to time; provided that they are similar in spirit to the current version of the Agreement, but may differ in detail to address new problems or concerns. All such changes will be effective immediately. Your continued use of the SAM Materials after any modification to this Agreement constitutes your agreement to such modification. Except as provided in this Agreement, no modification or addition to any provision of this Agreement will be binding unless it is in writing and signed by an authorized representative of both you and Meta.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420---base_model: facebook/sam-3d-objectsbase_model_relation: quantizedlicense: otherlicense_name: sam-licenselicense_link: https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/LICENSE-SAM.txtpipeline_tag: image-to-3dlibrary_name: onnxtags:- onnx- moonbox- onnxruntime- sam-3d- image-to-3d- 3d- mesh- pose-estimation- flow-matching- sparse-voxels---
# SAM 3D Objects ONNX
ONNX builds of [SAM 3D Objects](https://huggingface.co/facebook/sam-3d-objects), made by Moonbox for on-device use with ONNX Runtime (CPU, CUDA, DirectML). Eachprecision is one folder holding the graphs and a small Python `pipeline.py` that does the rest (image preprocessing,the sampling loop, mesh extraction); what the graphs take and return is under *How to run*.
## Files
The last column is the benchmark against the original PyTorch model (details under *How to run*): how closely eachmesh matches the original's, made from the same pictures and the same starting noise.
| Precision | File | Size | sha256 | Benchmark ||---|---|---|---|---|| fp16 | [`fp16/LICENSE-FlexiCubes.txt`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/LICENSE-FlexiCubes.txt) | 11.6 kB | `49bbe9114e49` | teacher forced (human_object / animal / kidsroom): point map rel. error 0.15 / 0.06 / 0.63 % (floor 0.15 / 0.06 / 0.62), structure SNR 55.8 / 41.8 / 40.1 dB (floor 57.8 / 32.9 / 40.8), voxel IoU 1.000 / 0.998 / 0.997 (floor 1.000 / 0.993 / 0.997), pose within 0.04 degrees / 0.06 %, latent SNR 51.2 / 52.6 / 48.3 dB (floor 51.3 / 52.5 / 48.3), mesh F-score@0.005 1.000 / 1.000 / 0.957 (the original's mesh against itself resampled: 0.957); end to end F-score 1.000 / 0.996 / 0.928 (the original in fp32: 0.970 / 0.997 / -); 45-50 s per object (84 s for the 30 MP kidsroom), ~7 GB peak || fp16 | [`fp16/LICENSE-SAM.txt`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/LICENSE-SAM.txt) | 8.2 kB | `b3a5a0e2d973` | (the same build: numbers in its first row) || fp16 | [`fp16/LICENSE-TRELLIS.txt`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/LICENSE-TRELLIS.txt) | 1.2 kB | `9906940f61b1` | (the same build: numbers in its first row) || fp16 | [`fp16/dino.onnx`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/dino.onnx) | 0.3 MB | `4abdace1d245` | (the same build: numbers in its first row) || fp16 | [`fp16/dino.onnx.data`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/dino.onnx.data) | 1.22 GB | `7dac4b145524` | (the same build: numbers in its first row) || fp16 | [`fp16/flexicubes_tables.npz`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/flexicubes_tables.npz) | 2.6 kB | `1d22bf7f2ec2` | (the same build: numbers in its first row) || fp16 | [`fp16/mesh_conv.onnx`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/mesh_conv.onnx) | 26.4 kB | `011ad908aa43` | (the same build: numbers in its first row) || fp16 | [`fp16/mesh_conv.onnx.data`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/mesh_conv.onnx.data) | 1.0 MB | `b039cb6b1cc1` | (the same build: numbers in its first row) || fp16 | [`fp16/mesh_dec.onnx`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/mesh_dec.onnx) | 0.9 MB | `4f251f0f0f15` | (the same build: numbers in its first row) || fp16 | [`fp16/mesh_dec.onnx.data`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/mesh_dec.onnx.data) | 180.3 MB | `747c4ef56d3d` | (the same build: numbers in its first row) || fp16 | [`fp16/mesh_gn.onnx`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/mesh_gn.onnx) | 3.1 kB | `9f14e6e0daee` | (the same build: numbers in its first row) || fp16 | [`fp16/mesh_out.onnx`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/mesh_out.onnx) | 27.6 kB | `81d16b8a1ae1` | (the same build: numbers in its first row) || fp16 | [`fp16/mesh_out.onnx.data`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/mesh_out.onnx.data) | 0.6 MB | `7464356dda05` | (the same build: numbers in its first row) || fp16 | [`fp16/moge.onnx`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/moge.onnx) | 0.5 MB | `bed5a78f547f` | (the same build: numbers in its first row) || fp16 | [`fp16/moge.onnx.data`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/moge.onnx.data) | 1.25 GB | `63bcec2af547` | (the same build: numbers in its first row) || fp16 | [`fp16/moge_pos_embed.npy`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/moge_pos_embed.npy) | 5.6 MB | `73231693ad7d` | (the same build: numbers in its first row) || fp16 | [`fp16/pipeline.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/pipeline.py) | 19.8 kB | `ca2737d2c700` | (the same build: numbers in its first row) || fp16 | [`fp16/pipeline_tables.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/pipeline_tables.py) | 11.5 kB | `e8b782170511` | (the same build: numbers in its first row) || fp16 | [`fp16/sam3d.json`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/sam3d.json) | 0.7 kB | `053f9eb79812` | (the same build: numbers in its first row) || fp16 | [`fp16/slat_flow.onnx`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/slat_flow.onnx) | 2.0 MB | `934a9a3c9f14` | (the same build: numbers in its first row) || fp16 | [`fp16/slat_flow.onnx.data`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/slat_flow.onnx.data) | 1.20 GB | `a7604b23aaf5` | (the same build: numbers in its first row) || fp16 | [`fp16/slat_fuse.onnx`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/slat_fuse.onnx) | 8.3 kB | `7046a06fe344` | (the same build: numbers in its first row) || fp16 | [`fp16/slat_fuse.onnx.data`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/slat_fuse.onnx.data) | 69.2 MB | `12e4f839d54f` | (the same build: numbers in its first row) || fp16 | [`fp16/ss_dec.onnx`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/ss_dec.onnx) | 38.7 kB | `c972c9067577` | (the same build: numbers in its first row) || fp16 | [`fp16/ss_dec.onnx.data`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/ss_dec.onnx.data) | 294.7 MB | `cd5672e0eed7` | (the same build: numbers in its first row) || fp16 | [`fp16/ss_flow.onnx`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/ss_flow.onnx) | 2.9 MB | `8c6f3de387ea` | (the same build: numbers in its first row) || fp16 | [`fp16/ss_flow.onnx.data`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/ss_flow.onnx.data) | 1.94 GB | `d27cd65f3313` | (the same build: numbers in its first row) || fp16 | [`fp16/ss_fuse.onnx`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/ss_fuse.onnx) | 57.2 kB | `e17b0b21223e` | (the same build: numbers in its first row) || fp16 | [`fp16/ss_fuse.onnx.data`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/ss_fuse.onnx.data) | 103.0 MB | `147c69c12555` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/LICENSE-MoGe.txt`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/LICENSE-MoGe.txt) | 12.7 kB | `be23f97f4a4a` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/moge_min.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/moge_min.py) | 5.6 kB | `56086fe43c6b` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/pytorch3d/LICENSE-pytorch3d.txt`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/pytorch3d/LICENSE-pytorch3d.txt) | 1.6 kB | `60fa54e4d132` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/pytorch3d/__init__.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/pytorch3d/__init__.py) | 0.1 kB | `c9cb6d0dda3b` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/pytorch3d/common/__init__.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/pytorch3d/common/__init__.py) | 0.1 kB | `2e9a6555cb74` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/pytorch3d/common/datatypes.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/pytorch3d/common/datatypes.py) | 1.8 kB | `ebb59bb050d6` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/pytorch3d/common/workaround/__init__.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/pytorch3d/common/workaround/__init__.py) | 0.3 kB | `3fa9e1e8e8cb` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/pytorch3d/common/workaround/symeig3x3.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/pytorch3d/common/workaround/symeig3x3.py) | 12.5 kB | `47cc34d41be1` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/pytorch3d/common/workaround/utils.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/pytorch3d/common/workaround/utils.py) | 0.9 kB | `3a4f12c4f79b` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/pytorch3d/transforms/__init__.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/pytorch3d/transforms/__init__.py) | 1.1 kB | `e8e77a00cba6` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/pytorch3d/transforms/math.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/pytorch3d/transforms/math.py) | 3.1 kB | `40591113fdfd` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/pytorch3d/transforms/rotation_conversions.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/pytorch3d/transforms/rotation_conversions.py) | 21.0 kB | `50bcdf2ca096` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/pytorch3d/transforms/se3.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/pytorch3d/transforms/se3.py) | 8.2 kB | `8b90c901c3ee` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/pytorch3d/transforms/so3.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/pytorch3d/transforms/so3.py) | 8.9 kB | `bf0408ea6712` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/pytorch3d/transforms/transform3d.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/pytorch3d/transforms/transform3d.py) | 33.5 kB | `f0dc0a909f38` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/LICENSE-SAM.txt`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/LICENSE-SAM.txt) | 8.3 kB | `315341214aa8` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/__init__.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/__init__.py) | 0.0 kB | `e3b0c44298fc` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/data/__init__.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/data/__init__.py) | 0.0 kB | `e3b0c44298fc` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/data/dataset/__init__.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/data/dataset/__init__.py) | 0.0 kB | `e3b0c44298fc` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/data/dataset/tdfy/__init__.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/data/dataset/tdfy/__init__.py) | 0.0 kB | `e3b0c44298fc` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/data/dataset/tdfy/img_and_mask_transforms.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/data/dataset/tdfy/img_and_mask_transforms.py) | 36.6 kB | `469e11797e1e` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/data/dataset/tdfy/img_processing.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/data/dataset/tdfy/img_processing.py) | 6.2 kB | `e6a77adaacfb` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/data/dataset/tdfy/pose_target.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/data/dataset/tdfy/pose_target.py) | 33.3 kB | `bfcf87545266` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/data/dataset/tdfy/preprocessor.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/data/dataset/tdfy/preprocessor.py) | 8.7 kB | `7385dbbc0393` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/data/dataset/tdfy/transforms_3d.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/data/dataset/tdfy/transforms_3d.py) | 1.6 kB | `afe324382897` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/data/utils.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/data/utils.py) | 1.0 kB | `91be95cec3b8` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/model/__init__.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/model/__init__.py) | 0.0 kB | `e3b0c44298fc` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/model/backbone/__init__.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/model/backbone/__init__.py) | 0.0 kB | `e3b0c44298fc` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/model/backbone/dit/__init__.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/model/backbone/dit/__init__.py) | 0.0 kB | `e3b0c44298fc` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/model/backbone/dit/embedder/__init__.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/model/backbone/dit/embedder/__init__.py) | 0.0 kB | `e3b0c44298fc` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/model/backbone/dit/embedder/point_remapper.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/model/backbone/dit/embedder/point_remapper.py) | 2.9 kB | `d64b1304c3aa` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/pipeline/__init__.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/pipeline/__init__.py) | 0.0 kB | `e3b0c44298fc` | (the same build: numbers in its first row) || fp16 | [`fp16/vendor/sam3d_objects/pipeline/inference_utils.py`](https://huggingface.co/moonbox-dev/sam-3d-objects-ONNX/blob/main/fp16/vendor/sam3d_objects/pipeline/inference_utils.py) | 9.7 kB | `24e9f20e3f68` | (the same build: numbers in its first row) |
## How to run
SAM 3D Objects (Meta: one picture plus a mask of an object in it, to the object's 3D mesh with colours and its posein the camera) as ONNX graphs plus `pipeline.py`, a numpy runtime that reproduces the official`InferencePipelinePointMap.run` (github.com/facebookresearch/sam-3d-objects) as its notebook calls it.
**What runs.** SAM 3D works on sparse voxels. The stages, one graph each:- **Point map:** MoGe-v1 (ViT-L, the depth model the official pipeline.yaml names) gives every pixel of the whole picture a 3D point and the camera's focal length.- **Image features:** DINOv2-L/14 with registers encodes four 518 x 518 pictures: the object's crop, the whole picture, and the mask of each. The checkpoints' four towers are the same frozen weights, so one graph serves all four passes.- **Conditions:** two fusers turn those tokens into each stage's condition. The structure stage's also embeds the object's point map, in patches.- **Structure and pose:** a mixture-of-transformers flow (964M) samples a 16^3 x 8 shape latent together with the object's pose: 6D rotation, translation and scale. It runs 25 Euler steps with classifier-free guidance 7 over the first half. A convolutional decoder turns the latent into a 64^3 occupancy grid, and the original's own pruning and downsampling keep its surface voxels (typically 4-30 thousand). The pose decoder puts the object in the camera.- **Latent:** a sparse flow transformer (TRELLIS v1 layout, 626M) samples 8 features per voxel in 25 steps.- **Mesh:** the mesh decoder (TRELLIS v1 sparse Swin) subdivides the voxels twice, to 256^3, and predicts FlexiCubes features with vertex colours. The mesh is extracted from those features in numpy.
**Not included:**- the Gaussian-splat decoder;- the original's mesh post-processing and texture baking (`with_mesh_postprocess`, `with_texture_baking`: off in the notebook's call too);- the layout post-optimisation (`with_layout_postprocess`, which renders the mesh against the point map with pytorch3d).
The mesh has its colour per vertex (`save_mesh` writes a GLB). The pose comes back as the original returns it:rotation quaternion, translation and scale in the camera's frame (PyTorch3D convention), with the cameraintrinsics from MoGe.
**The graphs.** ONNX has no sparse operations, so `pipeline.py` builds index tables from the voxel coordinates innumpy and the graphs use them:- a submanifold 3x3x3 convolution (spconv in the original) is 27 gathers of neighbour features times the kernel slices, summed in fp32;- the latent flow's and the mesh decoder's windowed attention runs over gathered windows (the mesh decoder's in eight groups of windows, one after another, to bound memory);- the mesh decoder runs as four graphs: up to 128^3 in one; its last block, at 256^3, chunk by chunk over the voxels (262,144 at a time), with the GroupNorm statistics of all voxels computed in numpy between two passes. The 256^3 convolution gathers straight from each voxel's 128^3 parent instead of copying its features 8 times.
| Graph | Inputs | Output ||---|---|---|| `moge.onnx` | `image14` [1, 3, h, w] (resized, normalised), `pos_embed`, `uv0` ... `uv3` (built in numpy for the picture's size) | `points` and `mask` at the network's resolution || `dino.onnx` | `pixels` [B, 3, 518, 518] in [0, 1] | `norm_tokens` [B, 1370, 1024], `prenorm_tokens` [B, 1374, 1024] || `ss_fuse.onnx` | the four token sets, `pointmap` / `rgb_pointmap` [B, 3, 518, 518] | `cond` [B, 7528, 1024] || `ss_flow.onnx` | `shape` [B, 4096, 8], `rotation6d` [B, 1, 6], `translation` [B, 1, 3], `scale` [B, 1, 3], `translation_scale` [B, 1, 1], `t` [B] (1000 t), `d` [B], `cond` | the five velocities || `ss_dec.onnx` | `z` [1, 8, 16, 16, 16] | occupancy logits [1, 1, 64, 64, 64] || `slat_fuse.onnx` | the four prenorm token sets | `cond` [B, 5496, 1024] || `slat_flow.onnx` | `feats` [N, 8], `t` [1], `cond`, index tables | velocity [N, 8] || `mesh_dec.onnx` | `slat` [N, 8], window and neighbour tables | `h128` / `x128` [8 N, 192] (the last block's normed / raw input) || `mesh_conv.onnx` | `h`: `h128`, `nbr` [C, 27] (the neighbours' parents) | first convolution [C, 96] || `mesh_gn.onnx` | `f`: that, `mean` / `rstd` [32] (over all voxels) | GroupNorm + SiLU [C, 96] || `mesh_out.onnx` | `g`: the normed features [64 N, 96], `nbr` [C, 27], `xs`: `x128`, `par` [C] | FlexiCubes features [C, 101] |
```pythonimport syssys.path.insert(0, "fp16")import pipelinefrom PIL import Imagep = pipeline.Sam3DObjects("fp16", "cuda")verts, faces, attrs, pose, K = p(Image.open("photo.png"), Image.open("mask.png"), seed=42)pipeline.save_mesh("object.glb", verts, faces, attrs) # y-up, vertex colours```
Or `python fp16/pipeline.py photo.png mask.png object.glb --seed 42`. The mask is a picture of the same size: anynon-zero pixel (or alpha) is the object. It needs numpy, scipy, Pillow and onnxruntime-gpu, plus torch andtorchvision on the CPU: the preprocessing and the pose decoding run the original's own code (`vendor/`). trimeshwrites the GLB.
**Ported as the original behaves.**- **Point map:** `MoGeModel.infer` at resolution level 9 (2,500 tokens): the same resizes, the focal length and depth shift recovered by the same solver (`vendor/moge_min.py`, MoGe's code), the points turned into PyTorch3D's camera axes as `compute_pointmap` does.- **Preprocessing:** the original's crop around the mask, resizes, padding and point-map normalisation (`vendor/sam3d_objects`, copied from the repository with only the imports edited).- **Sampler:** pipeline.yaml's settings: structure 25 steps with the time rescaled by 3 and guidance 7 while 1000 t <= 500 (the unconditional pass with the condition zeroed); latent 25 steps, no rescale, guidance 1.- **Voxels and pose:** the original's `prune_sparse_structure`, `downsample_sparse_structure` and `pose_decoder` ("ScaleShiftInvariant"), run as they are.- **Mesh:** FlexiCubes in numpy over the candidate cubes only (a port of TRELLIS's FlexiCubes, which SAM 3D uses unchanged): the original builds a dense 256^3 grid, which needs over 10 GB here once a structure has more than about 25 thousand voxels.- **Noise:** a seed draws the latents with torch's CPU generator in the original's order. The original draws on the GPU, so the same seed gives a different (equally valid) sample than the original's.- **Graph optimization:** sessions use the basic level and are loaded one at a time; the CUDA memory arena grows only by what each graph asks for.
**Running it.**- **Memory:** about 7 GB of system memory at the peak on Windows (GPU allocations count toward it) for the 6720 x 4480 kidsroom photo, whose structure has 26 thousand voxels; about 5 GB for the smaller examples. Graphs are loaded one at a time. The original needed about 10 GB here for that photo's mesh decoding alone.- **Time:** on an RTX 3080 Laptop GPU, 45-50 s per object from the picture with `fp16/` or `int8/` for the smaller examples (4-6 thousand voxels), 84 s for the kidsroom photo, loading each graph as its stage starts. The structure stage takes 26-30 s; the latent stage and the mesh grow with the voxel count (kidsroom: 28 s and 26 s).
**Precisions.**- `fp16/` (6.3 GB): the two flows' matrix products and the decoders in fp16, as the original runs them (it keeps fp32 weights under fp16 autocast); the flows' residual stream, the norms and the convolutions' sums in fp32. MoGe, DINOv2, the condition fusers and the structure decoder stay fp32.- `int8/` (4.9 GB), **experimental**: the two flows' MatMuls 8-bit MatMulNBits (block 32; 99.5 % and 93 % of their weights), the rest as `fp16/`. Below the pass mark on the structure and latent stages (below); end to end its meshes stay close (F-score 0.91-0.97), and its pose rotations are 0.3-0.6 degrees off the original's.- No int4: tried (the flows 4-bit) and far below the pass mark (structure SNR 8-16 dB; on the kidsroom it keeps 74 % of the voxels and the pose turns by 5 degrees). No bf16: fp16 passes.
**Benchmark.**- **Pictures:** three of the official repository's example images (notebook/images) with one of their masks each: human_object (mask 0: the bench, 1600 x 898), the animal at a waterhole (id3_shutterstock_WildAnimal_Waterhole, mask 0) and the stylish kids room (shutterstock_stylish_kidsroom, mask 14, 6720 x 4480); seed 42.- **Original:** `InferencePipelinePointMap` (GitHub @ f91db41, checkpoints facebook/sam-3d-objects @ 2e73555) run on Windows stage by stage with every intermediate saved: as it runs (fp32 weights under fp16 autocast), spconv, attention through PyTorch SDPA; the mesh from its decoder's features with the same numpy FlexiCubes as here (its dense 256^3 FlexiCubes doesn't fit at 26 thousand voxels).- **Teacher forced:** each stage is fed the original's own inputs (picture, preprocessed inputs, noise, voxels, latent) and scored against the original's output: - point map: relative error of the points (where both are finite) and the focal length; - structure: SNR of the shape latent, IoU of the voxels, and the pose (translation, rotation, scale); - latent: SNR; - mesh: F-score at 0.005 on 200k surface samples.- **Pass mark:** each stage at least as close as the original's own fp32 run of that stage, on the same inputs (the mean over the pictures).
| | point map: rel. error | structure: SNR / voxel IoU | pose: rotation | latent: SNR | mesh: F-score | end to end: voxel IoU / F-score ||---|---|---|---|---|---|---|| original in fp32 (the floor) | 0.15 / 0.06 / 0.62 % | 57.8 / 32.9 / 40.8 dB, 1.000 / 0.993 / 0.997 | 0 / 0 / 0 degrees | 51.3 / 52.5 / 48.3 dB | 1.000 / 1.000 / (0.957) | 1.000 / 0.997 / -, 0.970 / 0.997 / - || `fp16/` | 0.15 / 0.06 / 0.63 % | 55.8 / 41.8 / 40.1 dB, 1.000 / 0.998 / 0.997 | 0 / 0 / 0.04 degrees | 51.2 / 52.6 / 48.3 dB | 1.000 / 1.000 / 0.957 | 1.000 / 0.998 / 0.994, 1.000 / 0.996 / 0.928 || `int8/` (experimental) | (as `fp16/`) | 33.0 / 22.6 / 25.9 dB, 0.998 / 0.956 / 0.981 | 0.36 / 0.31 / 0.63 degrees | 33.7 / 33.9 / 32.9 dB | (as `fp16/`) | 0.996 / 0.957 / 0.979, 0.932 / 0.972 / 0.907 || int4 (not published) | (as `fp16/`) | 15.5 / 12.2 / 8.3 dB, 0.902 / 0.756 / 0.739 | 1.5 / 2.8 / 5.2 degrees | 9.4 / 10.5 / 9.0 dB | (as `fp16/`) | 0.901 / 0.757 / 0.738, 0.843 / 0.772 / 0.540 |
Columns are human_object / animal / kidsroom.- **The kidsroom mesh and end-to-end floors:** the original's fp32 mesh decoder doesn't fit in this machine's memory for the kidsroom. Its mesh is large (977 thousand faces), so 200k samples are sparse at the 0.005 tolerance: the original's own mesh scored against itself with another sampling gives 0.957, the score in brackets. `fp16/`'s mesh has exactly the original's 488,474 vertices.- **End to end:** from the picture and mask, with the original's structure noise (and its latent noise when the voxels come out the same). The floor is the original fully in fp32 from the picture. On human_object `fp16/` gives the original's voxels and mesh exactly; on the animal 99.8 % of its voxels.- **Pose:** translation and scale agree to 0.01-0.06 % in every teacher-forced fp16 run (0.1-0.6 % end to end).
Before the benchmark each graph was checked against its PyTorch module on real inputs (cosine): MoGe 0.99999999(the network's points against the original's fp32 forward); DINOv2 0.999998; the fusers 0.999997-0.999998; thestructure flow 0.999999 (against the original's autocast arithmetic); the structure decoder 0.99999999; the latentflow 0.999997; the mesh decoder's four graphs, run in chunks as `pipeline.py` runs them, 0.99999 against theoriginal decoder on 3,000 voxels.
**License.** SAM 3D Objects (code and weights) is under the SAM License (`LICENSE-SAM.txt`): it allows use andredistribution, and anyone redistributing it must pass the licence on with it. The vendored helpers keep their ownlicences, each next to its code: pytorch3d (BSD), MoGe (MIT; the MoGe-v1 weights Ruicheng/moge-vitl are MIT too),TRELLIS (MIT) and NVIDIA FlexiCubes (Apache-2.0).
## How these were made
From [SAM 3D Objects](https://huggingface.co/facebook/sam-3d-objects) at revision `2e73555018`. The graphs were exported from the original PyTorch modules withtorch.onnx (opset 17 / 18) and checked against them. Weight-only quantization: int8 is a per-output-channel int8weight behind DequantizeLinear, int4 is ONNX Runtime's MatMulNBits (block 32). Each card above says which precisionevery graph uses. Every precision was benchmarked against the original before upload (the pass mark is under *How to run*), and the`sha256` column above is what the files must hash to.
## License
SAM License (Meta). These files are a derivative of the original model and carry its license: it is copied in thisrepository, and it governs your use of these files. The original model card follows unchanged.
---
# Original model card
**When requesting access (IMPORTANT)** : *Please be sure to provide your full legal name, date of birth, and full organization name with all corporate identifiers. Avoid the use of acronyms and special characters. Failure to follow these instructions may prevent you from accessing this model and others on Hugging Face. You will not have the ability to edit this form after submission, so please ensure all information is accurate.*
# SAM 3D
SAM 3D Objects is one part of SAM 3D, a pair of models for object and human mesh reconstruction. If you’re looking for SAM 3D Body, [click here](https://github.com/facebookresearch/sam-3d-body).
# SAM 3D Objects
**SAM 3D Team**, [Xingyu Chen](https://scholar.google.com/citations?user=gjSHr6YAAAAJ&hl=en&oi=sra)\*, [Fu-Jen Chu](https://fujenchu.github.io/)\*, [Pierre Gleize](https://scholar.google.com/citations?user=4imOcw4AAAAJ&hl=en&oi=ao)\*, [Kevin J Liang](https://kevinjliang.github.io/)\*, [Alexander Sax](https://alexsax.github.io/)\*, [Hao Tang](https://scholar.google.com/citations?user=XY6Nh9YAAAAJ&hl=en&oi=sra)\*, [Weiyao Wang](https://sites.google.com/view/weiyaowang/home)\*, [Michelle Guo](https://scholar.google.com/citations?user=lyjjpNMAAAAJ&hl=en&oi=ao), [Thibaut Hardin](https://github.com/Thibaut-H), [Xiang Li](https://ryanxli.github.io/)⚬, [Aohan Lin](https://github.com/linaohan), [Jia-Wei Liu](https://jia-wei-liu.github.io/), [Ziqi Ma](https://ziqi-ma.github.io/)⚬, [Anushka Sagar](https://www.linkedin.com/in/anushkasagar/), [Bowen Song](https://scholar.google.com/citations?user=QQKVkfcAAAAJ&hl=en&oi=sra)⚬, [Xiaodong Wang](https://scholar.google.com/citations?authuser=2&user=rMpcFYgAAAAJ), [Jianing Yang](https://jedyang.com/)⚬, [Bowen Zhang](http://home.ustc.edu.cn/~zhangbowen/)⚬, [Piotr Dollár](https://pdollar.github.io/)†, [Georgia Gkioxari](https://georgiagkioxari.com/)†, [Matt Feiszli](https://scholar.google.com/citations?user=A-wA73gAAAAJ&hl=en&oi=ao)†§, [Jitendra Malik](https://people.eecs.berkeley.edu/~malik/)†§
***Meta Superintelligence Labs***
*Core contributor (Alphabetical, Equal Contribution), ⚬Intern, †Project leads, §Equal Contribution
[[`Paper`](https://ai.meta.com/research/publications/sam-3d-3dfy-anything-in-images/)] [[`Code`](https://github.com/facebookresearch/sam-3d-objects)] [[`Website`](https://ai.meta.com/sam3d/)] [[`Demo`](https://www.aidemos.meta.com/segment-anything/editor/convert-image-to-3d)] [[`Blog`](https://ai.meta.com/blog/sam-3d/)] [[`BibTeX`](#citing-sam-3d-objects)] [[`Roboflow`](https://blog.roboflow.com/sam-3d/)]
**SAM 3D Objects** is a foundation model that reconstructs full 3D shape geometry, texture, and layout from a single image, excelling in real-world scenarios with occlusion and clutter by using progressive training and a data engine with human feedback. It outperforms prior 3D generation models in human preference tests on real-world objects and scenes. We released code, weights, online demo, and a new challenging benchmark.
<p align="center"><img src="doc/intro.png"/></p>
-----
<p align="center"><img src="doc/arch.png"/></p>
## Latest updates
**11/19/2025** - Checkpoints Launched, Web Demo and Paper are out.
## Installation
Follow the [setup](https://github.com/facebookresearch/sam-3d-objects/blob/main/doc/setup.md) steps before running the following.
## Single or Multi-Object 3D Generation
SAM 3D Objects can convert masked objects in an image, into 3D models with pose.
<img src="doc/kidsroom.png" width="49%" style="display: inline-block;"/><img src="doc/kidsroom_transparent.gif" width="49%" style="display: inline-block;"/>
For a quick start, use the the following lines of code:
```pythonimport sys
# import inference codesys.path.append("notebook")from inference import Inference, load_image, load_single_mask
# load modeltag = "hf"config_path = f"checkpoints/{tag}/pipeline.yaml"inference = Inference(config_path, compile=False)
# load image (RGBA only, mask is embedded in the alpha channel)image = load_image("notebook/images/shutterstock_stylish_kidsroom_1640806567/image.png")mask = load_single_mask("notebook/images/shutterstock_stylish_kidsroom_1640806567", index=14)
# run modeloutput = inference(image, mask, seed=42)
# export gaussian splatoutput["gs"].save_ply(f"splat.ply")```
For more details and multi-object reconstruction, please take a look at out two jupyter notebooks:* [single object](https://github.com/facebookresearch/sam-3d-objects/blob/main/notebook/demo_single_object.ipynb)* [multi object](https://github.com/facebookresearch/sam-3d-objects/blob/main/notebook/demo_multi_object.ipynb)
## SAM 3D Body
[SAM 3D Body (3DB)](https://github.com/facebookresearch/sam-3d-body) is a robust promptable foundation model for single-image 3D human mesh recovery (HMR).
As a way to combine the strengths of both **SAM 3D Objects** and **SAM 3D Body**, we provide an example notebook that demonstrates how to combine the results of both models such that they are aligned in the same frame of reference. Check it out [here](https://github.com/facebookresearch/sam-3d-objects/blob/main/notebook/demo_3db_mesh_alignment.ipynb).
## License
The SAM 3D Objects model checkpoints and code are licensed under [SAM License](./LICENSE).
## Contributing
See [contributing](CONTRIBUTING.md) and the [code of conduct](CODE_OF_CONDUCT.md).
## Contributors
The SAM 3D Objects project was made possible with the help of many contributors.
Robbie Adkins,Paris Baptiste,Karen Bergan,Kai Brown,Michelle Chan,Ida Cheng,Khadijat Durojaiye,Patrick Edwards,Daniella Factor,Facundo Figueroa,Rene de la Fuente,Eva Galper,Cem Gokmen,Alex He,Enmanuel Hernandez,Dex Honsa,Leonna Jones,Arpit Kalla,Kris Kitani,Helen Klein,Kei Koyama,Robert Kuo,Vivian Lee,Alex Lende,Jonny Li,Kehan Lyu,Faye Ma,Mallika Malhotra,Sasha Mitts,William Ngan,George Orlin,Peter Park,Don Pinkus,Roman Radle,Nikhila Ravi,Azita Shokrpour,Jasmine Shone,Zayida Suber,Phillip Thomas,Tatum Turner,Joseph Walker,Meng Wang,Claudette Ward,Andrew Westbury,Lea Wilken,Nan Yang,Yael Yungster
## Citing SAM 3D Objects
If you use SAM 3D Objects in your research, please use the following BibTeX entry.
```@article{sam3dteam2025sam3d3dfyimages, title={SAM 3D: 3Dfy Anything in Images}, author={SAM 3D Team and Xingyu Chen and Fu-Jen Chu and Pierre Gleize and Kevin J Liang and Alexander Sax and Hao Tang and Weiyao Wang and Michelle Guo and Thibaut Hardin and Xiang Li and Aohan Lin and Jiawei Liu and Ziqi Ma and Anushka Sagar and Bowen Song and Xiaodong Wang and Jianing Yang and Bowen Zhang and Piotr Dollár and Georgia Gkioxari and Matt Feiszli and Jitendra Malik}, year={2025}, eprint={2511.16624}, archivePrefix={arXiv}, primaryClass={cs.CV}, url={https://arxiv.org/abs/2511.16624}, }```LICENSEAdded+52
LICENSE-SAM.txtAdded+52
README.mdAdded+420