Spaces:
Running
Running
Deploy SAM 3D Objects Studio with live inference and verified example
Browse files- .gitattributes +1 -0
- LICENSE +24 -0
- README.md +87 -11
- __vite-browser-external-Cgmn0awE-DlteDsMi.js +1 -0
- bus-mask.webp +0 -0
- bus.glb +3 -0
- bus.png +0 -0
- index-BN3vCEKQ.css +1 -0
- index-CYXg6sHP.js +0 -0
- index.html +57 -17
- source-code.zip +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
bus.glb filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2026 SAM 3D Objects Studio contributors
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
| 22 |
+
|
| 23 |
+
This license applies only to the application source. Third-party images,
|
| 24 |
+
model weights, and model outputs remain subject to their respective terms.
|
README.md
CHANGED
|
@@ -1,11 +1,87 @@
|
|
| 1 |
-
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk: static
|
| 7 |
-
|
| 8 |
-
short_description: Select an object in a photo and reconstruct it in 3D
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: SAM 3D Objects Studio
|
| 3 |
+
emoji: 🧊
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: blue
|
| 6 |
+
sdk: static
|
| 7 |
+
app_file: index.html
|
| 8 |
+
short_description: Select an object in a photo and reconstruct it in 3D
|
| 9 |
+
models:
|
| 10 |
+
- facebook/sam-3d-objects
|
| 11 |
+
- facebook/sam3
|
| 12 |
+
tags:
|
| 13 |
+
- image-to-3d
|
| 14 |
+
- 3d-modeling
|
| 15 |
+
- sam3d
|
| 16 |
+
- static
|
| 17 |
+
license: mit
|
| 18 |
+
pinned: false
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# SAM 3D Objects Studio
|
| 22 |
+
|
| 23 |
+
A free, browser-based demo for Meta's **SAM 3D Objects**: upload a photo, name
|
| 24 |
+
one object, and inspect/download the reconstructed vertex-colored GLB mesh.
|
| 25 |
+
|
| 26 |
+
## Architecture and limits
|
| 27 |
+
|
| 28 |
+
This is a **static frontend, not a standalone model deployment**. Live inference
|
| 29 |
+
uses the public [HaiderCG/sam3d-lab](https://huggingface.co/spaces/HaiderCG/sam3d-lab)
|
| 30 |
+
Gradio API, running **SAM 3 segmentation → SAM 3D Objects reconstruction**.
|
| 31 |
+
The frontend uses the official `@gradio/client` queue protocol and
|
| 32 |
+
`@google/model-viewer` for interactive GLB rendering.
|
| 33 |
+
|
| 34 |
+
- **No paid hardware**, API key, or embedded token is required by this frontend.
|
| 35 |
+
- Shared backend availability and Hugging Face ZeroGPU quotas apply. Requests can
|
| 36 |
+
queue or fail when capacity/quota is exhausted. No automatic backend switching.
|
| 37 |
+
- Uploaded images and prompts go directly to the named third-party backend.
|
| 38 |
+
**Do not upload confidential or personal images.** This frontend has no analytics
|
| 39 |
+
and does not persist uploads. The backend's own data policies still apply.
|
| 40 |
+
- Generation reconstructs the highest-scoring matching instance, not every object.
|
| 41 |
+
Use short English object names such as `bus`, `chair`, or `coffee mug`.
|
| 42 |
+
- Backend seed is 42. Mesh postprocessing, texture baking, and layout
|
| 43 |
+
postprocessing are disabled upstream; the output uses vertex colors rather
|
| 44 |
+
than a baked texture map. Hidden surfaces are model estimates, not measurements.
|
| 45 |
+
- The bus example's saved GLB is an actual SAM 3D Objects API result, clearly
|
| 46 |
+
labeled as a saved example. It remains inspectable without consuming GPU quota.
|
| 47 |
+
|
| 48 |
+
## Using the demo
|
| 49 |
+
|
| 50 |
+
1. Choose a PNG, JPEG, or WebP image (up to 20 MB / 20 megapixels), or load the bus example.
|
| 51 |
+
2. Name the object to reconstruct.
|
| 52 |
+
3. Select **Generate 3D**. A cold request can take a few minutes plus queue time.
|
| 53 |
+
4. Drag to orbit, scroll/pinch to zoom, and download the GLB or mask preview.
|
| 54 |
+
|
| 55 |
+
The **Saved result** button shows the bundled, verified bus reconstruction;
|
| 56 |
+
**Generate 3D** always sends a new inference request (it does not serve the cache).
|
| 57 |
+
Cancellation stops listening and cancels queued work where supported; work that
|
| 58 |
+
already started may continue on the shared GPU.
|
| 59 |
+
|
| 60 |
+
## Build / develop
|
| 61 |
+
|
| 62 |
+
The Space serves a prebuilt release. Download `source-code.zip` from the Files
|
| 63 |
+
tab for the complete editable Vite project. Extract it before the commands below.
|
| 64 |
+
|
| 65 |
+
Node.js 22.12+ (Node 24 recommended):
|
| 66 |
+
|
| 67 |
+
```bash
|
| 68 |
+
npm ci
|
| 69 |
+
npm test
|
| 70 |
+
npm run build
|
| 71 |
+
npm run dev
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
Run `npm run build`, then upload the contents of `dist/` to this repository's root, retaining this README. The Space serves `index.html` without paid build/runtime hardware.
|
| 75 |
+
Do not put access tokens in JavaScript, static Space variables, or this repository.
|
| 76 |
+
|
| 77 |
+
## Credits and licenses
|
| 78 |
+
|
| 79 |
+
- Model: [facebook/sam-3d-objects](https://huggingface.co/facebook/sam-3d-objects),
|
| 80 |
+
[Meta source](https://github.com/facebookresearch/sam-3d-objects), **SAM License**.
|
| 81 |
+
- Segmentation: [facebook/sam3](https://huggingface.co/facebook/sam3); its own license applies.
|
| 82 |
+
- Public inference: [HaiderCG/sam3d-lab](https://huggingface.co/spaces/HaiderCG/sam3d-lab).
|
| 83 |
+
- Bus test image: [Gradio repository test fixture](https://github.com/gradio-app/gradio/blob/main/test/test_files/bus.png).
|
| 84 |
+
- Application source is MIT licensed. This does **not** relicense model weights,
|
| 85 |
+
the example image, or generated outputs. Review the upstream model terms for use.
|
| 86 |
+
|
| 87 |
+
An independent community demo; not an official Meta application.
|
__vite-browser-external-Cgmn0awE-DlteDsMi.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{t as e}from"./index-CYXg6sHP.js";var t=e(((e,t)=>{t.exports={}}))();export{t as default};
|
bus-mask.webp
ADDED
|
bus.glb
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9d74c512c1a99652e68b282e1322acb34df0f34ff5e5605d0370210676c9c13e
|
| 3 |
+
size 27113676
|
bus.png
ADDED
|
index-BN3vCEKQ.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
@import "https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700&family=Manrope:wght@400;500;600;650;700;750;800&display=swap";:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--bg:#101412;--panel:#181d1a;--stage:#131815;--line:#2c352e;--ink:#edf3ee;--muted:#97a49a;--accent:#b6f7bb;--danger:#ffb6a6;font-synthesis:none;font-family:DM Sans,sans-serif}*{box-sizing:border-box}body{background:var(--bg);color:var(--ink);margin:0}button,input,a{-webkit-tap-highlight-color:transparent}button,input{font:inherit}button,a,input,label{outline-offset:5px}button:focus-visible,a:focus-visible,input:focus-visible,.dropzone:focus-within{outline:2px solid var(--accent)}button{cursor:pointer}button:disabled{cursor:default;opacity:.4}a,button{color:inherit}button[hidden],div[hidden],img[hidden],span[hidden],model-viewer[hidden]{display:none!important}.app{max-width:1392px;margin:auto;padding:0 54px}.topbar{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;height:88px;display:flex}.brand{letter-spacing:-.5px;align-items:center;gap:9px;font-size:17px;font-weight:700;text-decoration:none;display:flex}.brand-icon{color:var(--accent);margin-right:3px;font-size:32px;font-weight:400;line-height:1}.brand-light{color:#bec9c0;font-weight:400}.model-link{color:var(--muted);font-size:12px;text-decoration:none}.model-link span{color:var(--ink);margin-left:17px}.intro{justify-content:space-between;align-items:center;padding:45px 0 40px;display:flex}.eyebrow{letter-spacing:2px;color:var(--accent);margin:0 0 17px;font-size:10px}h1{letter-spacing:-2.5px;margin:0;font:650 49px/1.1 Manrope,sans-serif}h1 span{color:var(--accent)}.intro-copy{color:var(--muted);margin:18px 0 0;font-size:13px;line-height:1.65}.intro-note{text-align:right;padding:0 4px}.small-cube{color:var(--accent);font-size:44px;line-height:1}.intro-note p{color:var(--muted);font-size:12px;line-height:1.65}.intro-note strong{color:var(--ink);font-weight:500}.tag{letter-spacing:1.1px;color:var(--muted);border:1px solid var(--line);border-radius:4px;padding:5px 7px;font-size:8px}.workspace{border:1px solid var(--line);background:var(--panel);border-radius:13px;grid-template-columns:350px minmax(0,1fr);display:grid;overflow:hidden}.input-panel{border-right:1px solid var(--line);padding:24px}.panel-heading{justify-content:space-between;align-items:center;margin-bottom:18px;display:flex}h2,.prompt-block label{margin:0;font-size:12px;font-weight:550}.step{color:var(--muted);border:1px solid #3d473f;border-radius:4px;margin-right:8px;padding:3px 5px;font-size:9px;display:inline-block}.text-button{color:var(--muted);background:0 0;border:0;padding:2px 0;font-size:10px}.text-button:hover{color:var(--accent)}.dropzone{cursor:pointer;background:#131815;border:1px dashed #435347;border-radius:8px;justify-content:center;align-items:center;height:233px;transition:border-color .15s;display:flex;position:relative;overflow:hidden}.dropzone:hover,.dropzone.dragging{border-color:var(--accent);background:#1b251e}.dropzone input{opacity:0;width:1px;height:1px;position:absolute;bottom:0;left:0}.upload-placeholder{text-align:center;flex-direction:column;align-items:center;gap:7px;display:flex}.upload-symbol{color:var(--accent);margin-bottom:5px;font-size:32px;font-weight:400}.upload-placeholder strong{font-size:12px;font-weight:500}.upload-placeholder>span:not(.upload-symbol){color:var(--muted);font-size:11px}.upload-placeholder small{color:#6d7d71;margin-top:14px;font-size:9px}#source-image{object-fit:contain;width:100%;height:100%;padding:8px}.image-name{text-overflow:ellipsis;white-space:nowrap;color:#d5dfd7;background:#101412de;border-radius:4px;padding:5px 8px;font-size:9px;position:absolute;bottom:8px;left:8px;right:8px;overflow:hidden}.example-row{justify-content:space-between;align-items:center;gap:8px;margin:13px 0 26px;display:flex}.example-row>span{color:var(--muted);font-size:10px}.example-button{background:#212923;border:1px solid #354338;border-radius:5px;align-items:center;gap:8px;padding:4px 8px 4px 4px;font-size:10px;display:flex}.example-button img{object-fit:cover;border-radius:3px;width:23px;height:23px}.example-button>span{color:var(--muted);margin-left:8px}.example-button:hover{border-color:var(--accent)}.prompt-block label{margin-bottom:12px;display:block}.prompt-block input{width:100%;color:var(--ink);background:#111713;border:1px solid #3c483f;border-radius:6px;padding:12px 11px;font-size:11px}.prompt-block input::placeholder{color:#7e8e82}.prompt-block p{color:var(--muted);margin:9px 0 22px;font-size:9px;line-height:1.6}.primary-button{background:var(--accent);color:#142617;border:0;border-radius:6px;justify-content:space-between;align-items:center;width:100%;padding:13px 15px;font-size:12px;font-weight:600;transition:background .15s;display:flex}.primary-button:hover{background:#ccffcf}.primary-button:disabled{opacity:.65}.primary-button>span:last-child{font-size:17px;font-weight:400}.cancel-button{background:0 0;border:1px solid #48574c;border-radius:5px;width:100%;margin-top:9px;padding:9px;font-size:10px}.privacy-note{color:#89988d;margin:13px 0 0;font-size:9px;line-height:1.7}.privacy-note a{color:#b8c5bc;text-underline-offset:2px}.output-panel{background:var(--stage);flex-direction:column;min-width:0;display:flex}.viewer-toolbar{border-bottom:1px solid #26312a;justify-content:space-between;align-items:center;height:58px;padding:0 22px;display:flex}.tabs{align-self:stretch;gap:20px;display:flex}.tab{color:var(--muted);background:0 0;border:none;border-bottom:2px solid #0000;padding:1px 0 0;font-size:11px}.tab.active{color:var(--accent);border-bottom-color:var(--accent)}.viewer-badge{letter-spacing:1px;color:#8b9c8e;font-size:8px}.viewer-stage{isolation:isolate;background-image:radial-gradient(#3b4a3e70 .7px,#0000 .7px);background-size:20px 20px;height:402px;position:relative}.viewer-stage:after{content:"";z-index:-1;pointer-events:none;background:radial-gradient(#13181500 20%,#131815b0 90%);position:absolute;inset:0}#model-pane,#mask-pane{width:100%;height:100%}model-viewer{--progress-bar-color:var(--accent);--poster-color:transparent;width:100%;height:100%}.empty-state{text-align:center;flex-direction:column;justify-content:center;align-items:center;height:100%;display:flex}.wire-cube{color:#658a6c;width:98px;height:108px;margin-bottom:13px}.empty-state h3{letter-spacing:-.5px;margin:0 0 9px;font:500 18px Manrope,sans-serif}.empty-state p{color:var(--muted);margin:0 0 19px;font-size:11px;line-height:1.7}.secondary-button{color:#cce5d1;background:#1a251d;border:1px solid #485c4c;border-radius:5px;padding:9px 12px;font-size:10px}.secondary-button:hover{border-color:var(--accent)}.secondary-button span{margin-left:12px}#mask-pane{justify-content:center;align-items:center;padding:20px;display:flex}#mask-image{object-fit:contain;width:100%;height:100%}#mask-empty{color:var(--muted);text-align:center;font-size:12px}.busy-overlay{z-index:3;text-align:center;background:#111813f2;flex-direction:column;justify-content:center;align-items:center;padding:25px;display:flex;position:absolute;inset:0}.spinner{border:2px solid #374b3c;border-top-color:var(--accent);border-radius:50%;width:29px;height:29px;margin-bottom:20px;animation:1s linear infinite spin}.busy-overlay strong{font-size:13px;font-weight:500}.busy-overlay p{color:var(--muted);max-width:270px;font-size:11px;line-height:1.7}.busy-overlay #elapsed{color:var(--accent);font-variant-numeric:tabular-nums;margin-top:15px;font-size:10px}.viewer-bottom{border-top:1px solid #27322a;justify-content:space-between;align-items:center;gap:8px;padding:12px 21px;display:flex}.controls-hint{color:#849488;white-space:nowrap;font-size:9px}.controls-hint>span{padding:0 7px}.viewer-actions{gap:15px;display:flex}.viewer-actions .text-button{font-size:9px}.result-bar{border-top:1px solid var(--line);flex:1;justify-content:space-between;align-items:center;gap:16px;padding:20px 22px;display:flex}.result-bar>div{flex-direction:column;gap:5px;min-width:0;display:flex}.result-label{letter-spacing:1.3px;color:#809185;font-size:8px}.result-bar strong{overflow-wrap:anywhere;font-size:12px;font-weight:500}.result-bar #result-detail{color:var(--muted);font-size:9px;line-height:1.5}.download-button{color:var(--accent);white-space:nowrap;background:#26392a;border:1px solid #465b4b;border-radius:5px;padding:11px 12px;font-size:10px;text-decoration:none}.download-button>span{padding-left:12px}.download-button.disabled{opacity:.4;pointer-events:none}.download-button:hover{background:#314b36}.status-line{color:var(--muted);align-items:baseline;gap:9px;min-height:20px;margin:14px 0 0;font-size:10px;line-height:1.7;display:flex}.status-dot{background:var(--accent);border-radius:50%;flex-shrink:0;align-self:flex-start;width:5px;height:5px;margin-top:6px}.status-line.error{color:var(--danger)}.status-line.error .status-dot{background:var(--danger)}.notes{grid-template-columns:repeat(3,1fr);gap:25px;padding:31px 0 27px;display:grid}.notes>div>span{letter-spacing:1.2px;color:#bfd0c3;font-size:8px}.notes p{color:#87988c;margin:10px 0 0;font-size:11px;line-height:1.7}.about{border-top:1px solid var(--line);color:var(--muted);padding:15px 0;font-size:10px;line-height:1.8}.about summary{cursor:pointer;color:#a8b8ad}.about p{max-width:900px}.about a{color:#c3d9c9;text-underline-offset:3px}footer{color:#7e9184;border-top:1px solid var(--line);justify-content:space-between;align-items:center;gap:12px;padding:22px 0 30px;font-size:9px;display:flex}footer>span{letter-spacing:1.1px}footer>div{gap:25px;display:flex}footer a{text-decoration:none}footer a:hover{color:var(--accent)}@keyframes spin{to{transform:rotate(360deg)}}@media (width>=1500px){.app{max-width:1440px}.viewer-stage{height:440px}.dropzone{height:270px}}@media (width<=1000px){.app{padding:0 28px}.workspace{grid-template-columns:310px minmax(0,1fr)}.input-panel{padding:21px}.viewer-stage{height:400px}.result-bar{flex-direction:column;align-items:flex-start;gap:12px;padding:17px}.result-bar>div{gap:4px}.viewer-toolbar{padding:0 17px}.viewer-badge{font-size:7px}.viewer-bottom{flex-wrap:wrap;padding:12px 17px}.intro{padding:36px 0}.intro h1{font-size:44px}}@media (width<=730px){.app{padding:0 18px}.topbar{height:70px}.brand{gap:6px;font-size:13px}.brand-icon{font-size:27px}.model-link{font-size:10px}.model-link span{margin-left:5px}.intro{padding:30px 0}.intro h1{letter-spacing:-1.7px;font-size:38px}.intro-note{display:none}.intro-copy{font-size:12px}.eyebrow{margin-bottom:14px;font-size:9px}.workspace{grid-template-columns:1fr}.input-panel{border-right:0;border-bottom:1px solid var(--line);padding:20px}.dropzone{height:225px}.example-row{margin-bottom:23px}.viewer-stage{height:380px}.result-bar{flex-direction:row;align-items:center;padding:19px}.viewer-toolbar{height:53px}.notes{gap:14px;padding:27px 0}.notes>div>span{letter-spacing:.6px;font-size:7px}.notes p{font-size:10px}.notes br{display:none}footer{align-items:flex-start;font-size:8px;line-height:1.6}footer>div{gap:11px}.empty-state h3{font-size:17px}.viewer-actions{gap:14px}}@media (prefers-reduced-motion:reduce){.spinner{animation-duration:2s}*{scroll-behavior:auto!important}}
|
index-CYXg6sHP.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
index.html
CHANGED
|
@@ -1,19 +1,59 @@
|
|
| 1 |
<!doctype html>
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 1 |
<!doctype html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8" />
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
+
<meta name="theme-color" content="#101412" />
|
| 7 |
+
<meta name="description" content="Turn an object in a photo into an interactive 3D model with Meta SAM 3D Objects. Independent demo with a shared public inference backend." />
|
| 8 |
+
<title>SAM 3D Objects Studio</title>
|
| 9 |
+
<script type="module" crossorigin src="./index-CYXg6sHP.js"></script>
|
| 10 |
+
<link rel="stylesheet" crossorigin href="./index-BN3vCEKQ.css">
|
| 11 |
+
</head>
|
| 12 |
+
<body>
|
| 13 |
+
<div class="app">
|
| 14 |
+
<header class="topbar">
|
| 15 |
+
<a class="brand" href="./" aria-label="SAM 3D Objects Studio home"><span class="brand-icon">◈</span> SAM 3D <span class="brand-light">Objects Studio</span></a>
|
| 16 |
+
<a class="model-link" href="https://huggingface.co/facebook/sam-3d-objects" target="_blank" rel="noopener noreferrer">Model card <span aria-hidden="true">↗</span></a>
|
| 17 |
+
</header>
|
| 18 |
+
<main>
|
| 19 |
+
<section class="intro">
|
| 20 |
+
<div><p class="eyebrow">IMAGE → OBJECT → 3D</p><h1>A new dimension<br>for your photos<span>.</span></h1><p class="intro-copy">Pick an object. Give it depth.<br>Reconstruct shape and color from a single image.</p></div>
|
| 21 |
+
<div class="intro-note"><span class="small-cube" aria-hidden="true">⬡</span><p>Powered by Meta's<br><strong>SAM 3D Objects</strong></p><span class="tag">COMMUNITY DEMO</span></div>
|
| 22 |
+
</section>
|
| 23 |
+
<section class="workspace" aria-label="Image to 3D workspace">
|
| 24 |
+
<form id="generate-form" class="input-panel">
|
| 25 |
+
<div class="panel-heading"><h2><span class="step">01</span> Source image</h2><button id="clear" class="text-button" type="button" hidden>Clear</button></div>
|
| 26 |
+
<label class="dropzone" id="dropzone" for="image-upload">
|
| 27 |
+
<input id="image-upload" type="file" accept="image/png,image/jpeg,image/webp" />
|
| 28 |
+
<span id="upload-placeholder" class="upload-placeholder"><span class="upload-symbol" aria-hidden="true">↥</span><strong>Drop an image here</strong><span>or click to browse</span><small>PNG, JPG, WEBP · up to 20 MB</small></span>
|
| 29 |
+
<img id="source-image" alt="Selected source image" hidden />
|
| 30 |
+
<span id="image-name" class="image-name" hidden></span>
|
| 31 |
+
</label>
|
| 32 |
+
<div class="example-row"><span>Start with an example</span><button type="button" id="example" class="example-button"><img src="./bus.png" alt="" /> Bus <span aria-hidden="true">↗</span></button></div>
|
| 33 |
+
<div class="prompt-block"><label for="prompt"><span class="step">02</span> Choose your object</label><input id="prompt" type="text" value="" maxlength="160" placeholder="e.g. chair, coffee mug, yellow bus" autocomplete="off" required /><p>The best-matching object will be selected automatically.</p></div>
|
| 34 |
+
<button id="generate" type="submit" class="primary-button"><span>Generate 3D</span><span aria-hidden="true">↗</span></button>
|
| 35 |
+
<button id="cancel" type="button" class="cancel-button" hidden>Cancel request</button>
|
| 36 |
+
<p class="privacy-note">Images are sent to a <a href="https://huggingface.co/spaces/HaiderCG/sam3d-lab" target="_blank" rel="noopener noreferrer">shared public backend ↗</a>.<br>Don't upload confidential images. Queue and quota limits apply.</p>
|
| 37 |
+
</form>
|
| 38 |
+
<div class="output-panel">
|
| 39 |
+
<div class="viewer-toolbar"><div class="tabs" role="tablist" aria-label="Output view"><button type="button" id="model-tab" class="tab active" role="tab" aria-selected="true" aria-controls="model-pane">3D model</button><button type="button" id="mask-tab" class="tab" role="tab" aria-selected="false" aria-controls="mask-pane">Object mask</button></div><span id="result-badge" class="viewer-badge">LIVE WORKSPACE</span></div>
|
| 40 |
+
<div class="viewer-stage">
|
| 41 |
+
<div id="model-pane" role="tabpanel" aria-labelledby="model-tab">
|
| 42 |
+
<model-viewer id="viewer" alt="Reconstructed 3D object. Drag to orbit and scroll or pinch to zoom." camera-controls touch-action="pan-y" shadow-intensity="0.7" exposure="1.1" environment-image="neutral" camera-orbit="35deg 70deg auto" interaction-prompt="none" hidden></model-viewer>
|
| 43 |
+
<div id="empty-state" class="empty-state"><svg class="wire-cube" width="148" height="160" viewBox="0 0 148 160" fill="none" aria-hidden="true"><path d="M74 17 130 49V112L74 145 18 112V49L74 17Z M18 49 74 82 130 49 M74 82V145" stroke="currentColor" stroke-width="1.1"/><path d="M74 17V82 M18 112 74 82 130 112" stroke="currentColor" stroke-width=".7" stroke-dasharray="3 5"/><circle cx="74" cy="82" r="5" fill="#b6f7bb"/><circle cx="74" cy="17" r="2.5" fill="currentColor"/><circle cx="130" cy="112" r="2.5" fill="currentColor"/></svg><h3>Your object, from every angle.</h3><p>Upload a photo to create a 3D model,<br>or explore a real saved reconstruction.</p><button id="saved-example" class="secondary-button" type="button">Explore saved bus result <span aria-hidden="true">↗</span></button></div>
|
| 44 |
+
</div>
|
| 45 |
+
<div id="mask-pane" role="tabpanel" aria-labelledby="mask-tab" hidden><img id="mask-image" alt="SAM 3 object selection highlighted in green" hidden /><p id="mask-empty">The selected object appears here after reconstruction.</p></div>
|
| 46 |
+
<div id="busy-overlay" class="busy-overlay" hidden><span class="spinner" aria-hidden="true"></span><strong id="busy-label">Connecting to the backend…</strong><p>Keep this tab open. Cold requests can take a few minutes.</p><span id="elapsed">0:00 elapsed</span></div>
|
| 47 |
+
</div>
|
| 48 |
+
<div class="viewer-bottom"><span class="controls-hint">↔ Drag to orbit <span>·</span> Scroll to zoom</span><div class="viewer-actions"><button id="rotate" type="button" class="text-button" disabled aria-pressed="false">Auto-rotate</button><button id="reset-camera" type="button" class="text-button" disabled>Reset view ↺</button></div></div>
|
| 49 |
+
<div class="result-bar"><div><span class="result-label">OUTPUT</span><strong id="result-summary">No reconstruction yet</strong><span id="result-detail">Vertex-colored mesh · GLB format</span></div><a id="download" class="download-button disabled" aria-disabled="true">Download GLB <span aria-hidden="true">↓</span></a></div>
|
| 50 |
+
</div>
|
| 51 |
+
</section>
|
| 52 |
+
<div id="status" class="status-line" role="status" aria-live="polite"><span class="status-dot"></span><span id="status-text">Ready when you are. Choose an image to begin.</span></div>
|
| 53 |
+
<section class="notes"><div><span>01 / SELECT</span><p>A clear subject works best.<br>Use a short, specific object name.</p></div><div><span>02 / RECONSTRUCT</span><p>SAM 3 selects the object.<br>SAM 3D estimates its complete shape.</p></div><div><span>03 / TAKE IT WITH YOU</span><p>Orbit the result, inspect the mask,<br>then download your GLB mesh.</p></div></section>
|
| 54 |
+
<details class="about"><summary>About this demo & limitations</summary><p>This free static Space calls <a href="https://huggingface.co/spaces/HaiderCG/sam3d-lab" target="_blank" rel="noopener noreferrer">HaiderCG/sam3d-lab</a>; it does not host the model weights. Availability depends on that shared backend and Hugging Face ZeroGPU quotas. Meshes use vertex colors, not baked texture maps. Hidden geometry is estimated and is not a reliable physical measurement. Seed: 42. The saved bus result is a real prior inference, not a live generation. For quota or backend issues, <a href="https://huggingface.co/spaces/HaiderCG/sam3d-lab" target="_blank" rel="noopener noreferrer">open the backend directly</a> and sign in there if needed.</p><p>Independent demo, not affiliated with Meta. Model and outputs are subject to the <a href="https://huggingface.co/facebook/sam-3d-objects" target="_blank" rel="noopener noreferrer">upstream SAM license</a>. The example image is from Gradio's public test fixtures.</p></details>
|
| 55 |
+
</main>
|
| 56 |
+
<footer><span>SAM 3D OBJECTS STUDIO</span><div><a href="https://github.com/facebookresearch/sam-3d-objects" target="_blank" rel="noopener noreferrer">Research & code ↗</a><a href="https://huggingface.co/spaces/samuel4038/sam3d-objects-studio/tree/main" id="source-link" target="_blank" rel="noopener noreferrer">Space source ↗</a></div></footer>
|
| 57 |
+
</div>
|
| 58 |
+
</body>
|
| 59 |
</html>
|
source-code.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c942bff1cc2b86899e01c6600b752c450de99696009d1e082cc7d0c45815ef5a
|
| 3 |
+
size 12702133
|