junaid-simamdigital commited on
Commit
3d2be66
·
verified ·
1 Parent(s): 95f5d0f

docs: target Nested direct-GS model

Browse files
Files changed (1) hide show
  1. README.md +215 -16
README.md CHANGED
@@ -1,23 +1,222 @@
1
  ---
2
- title: Simam3D DA3 GPU (Experimental)
3
- emoji: 🧪
4
- colorFrom: purple
5
- colorTo: indigo
6
- sdk: gradio
7
- app_file: app.py
8
- suggested_hardware: zero-a10g
9
- pinned: false
 
 
 
 
 
10
  models:
11
  - depth-anything/Depth-Anything-V2-Small-hf
12
- - depth-anything/DA3-LARGE-1.1
13
  ---
14
 
15
- # Simam3D DA3 GPU (Experimental)
16
 
17
- An isolated camera-aware research deployment of Simam3D. It uses the pinned
18
- Depth Anything 3 source package and the refreshed DA3-LARGE-1.1 checkpoint.
 
 
 
 
19
 
20
- This Space is experimental: use the Diagnostics panel and downloaded manifest
21
- to verify DA3 import, model loading, camera metadata, and output claims before
22
- using any result as metric-scale geometry. The stable V2 GPU deployment remains
23
- available at `Simam3D-GPU`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: Simam3D
3
+ emoji: 🧭
4
+ colorFrom: indigo
5
+ colorTo: blue
6
+ sdk: docker
7
+ app_port: 7860
8
+ suggested_hardware: a10g-large
9
+ pinned: true
10
+ tags:
11
+ - image-to-3d
12
+ - depth-estimation
13
+ - gaussian-splatting
14
+ - multi-view-reconstruction
15
  models:
16
  - depth-anything/Depth-Anything-V2-Small-hf
17
+ - depth-anything/DA3NESTED-GIANT-LARGE-1.1
18
  ---
19
 
20
+ # Simam3D
21
 
22
+ Simam3D is a modular image-to-3D workbench. Version 0.3 provides a tested
23
+ depth-to-geometry baseline: it predicts depth, visualizes confidence-ready
24
+ depth data, and exports a textured height-field GLB. The architecture is
25
+ designed for the next stages: Depth Anything 3 multi-view geometry, generated
26
+ back/side views, confidence-weighted fusion, Gaussian splats, and TRELLIS.2 or
27
+ Hunyuan3D mesh completion.
28
 
29
+ This first version intentionally keeps the inference path small and observable
30
+ so every stage can be tested independently on Hugging Face Spaces. Each run
31
+ produces inspectable outputs: colorized depth and confidence images, a textured
32
+ GLB scaffold, a confidence-preserving per-view PLY point cloud, a confidence-weighted fused
33
+ PLY, a viewer-compatible Gaussian-splat PLY, and an NPZ package containing
34
+ depth, confidence, extrinsics, and intrinsics arrays.
35
+ The per-view and fused PLY files retain `confidence`; fused points also retain
36
+ the dominant contributing `source_view` identifier for downstream inspection
37
+ and evaluation.
38
+ Fused and Gaussian PLY files also retain a `source_mask` bitmask showing which
39
+ input views contributed to each voxel, alongside the dominant pointer and the
40
+ derived Gaussian opacity/scale initialization.
41
+ It also emits a shareable evidence-card PNG that places the source, depth, and
42
+ confidence views beside the measured fusion statistics.
43
+ The **What's Behind the Image?** panel lets a user record a scene hypothesis,
44
+ extracts semantic cue labels, estimates image-space illumination direction, and
45
+ exports a reveal card pairing the original with the depth result. The reveal is
46
+ explicitly a hypothesis: a single image cannot verify unseen geometry. Additional
47
+ views and the manifest provide the evidence trail for future completion models.
48
+ The analysis also reports a depth-normal photometric light vector; this is a
49
+ heuristic lighting cue and is not a claim of physically correct illumination.
50
+ Each run also exports a reveal-uncertainty map and a deterministic next-view plan;
51
+ these prioritize acquisition around low-confidence or discontinuous regions.
52
+ It also exports a lightweight 12-frame turntable GIF rendered from the fused
53
+ points, making the reconstruction immediately inspectable and shareable.
54
+ The run report projects fused points back into each input camera and records
55
+ in-frame coverage as a diagnostic for pose or fusion collapse; coverage is a
56
+ consistency signal, not a geometric accuracy score. It also reports relative
57
+ depth reprojection error, comparing the fused raster with each input depth map.
58
+ For troubleshooting, the UI includes an explicitly labeled deterministic export
59
+ smoke test that bypasses model inference and exercises the complete artifact
60
+ pipeline on CPU.
61
+ The reproducibility manifest includes the app/schema version, an explicit
62
+ provenance claims contract, software
63
+ versions, SHA-256 fingerprints for every input and exported artifact, and
64
+ normalized dimensions for every input view.
65
+ Downloaded runs can be checked with `python validate_manifest.py
66
+ path/to/*_run.json`; the validator reports missing or tampered artifacts and
67
+ also verifies structured failure reports.
68
+ Multiple manifests can be compared with `python summarize_runs.py output`,
69
+ which emits backend, view-count, fusion, coverage, reprojection, fallback, and
70
+ provenance fields as JSON. Failed manifests are included with their status,
71
+ failing stage, and structured error details.
72
+ The dependency-free regression harness can be run with
73
+ `python benchmark_pipeline.py --output benchmark_output`. It repeats the CPU
74
+ fusion fixture at several resolutions and records signatures plus fusion
75
+ metrics. This proves deterministic geometry/export behavior only; it is not a
76
+ learned reconstruction-quality benchmark.
77
+ On Windows, run `powershell -ExecutionPolicy Bypass -File run_checks.ps1` before
78
+ publishing a change; this is the canonical compile and regression gate.
79
+ The DA3 package-layout resolver is tested independently in `da3_compat.py`, so
80
+ optional upstream import changes can be diagnosed without loading model
81
+ weights.
82
+ The model-free geometry path can also be exercised with
83
+ `python demo_pipeline.py --output demo_output`; it writes deterministic fused
84
+ and Gaussian artifacts for CPU-only integration testing.
85
+ The demo also emits a schema-3 manifest, so it can be checked with the same
86
+ `validate_manifest.py` tool as a model-backed run.
87
+ See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for the scheduler, smoke-test, and
88
+ browser-versus-server failure decision tree.
89
+ The research direction and required ablations are outlined in
90
+ [PAPER_OUTLINE.md](PAPER_OUTLINE.md).
91
+ The verified milestone history is recorded in [CHANGELOG.md](CHANGELOG.md).
92
+ Fusion metrics also report the number of distinct dominant source views in the
93
+ fused result, making view collapse visible without overstating provenance.
94
+ They report the fraction of voxels supported by multiple views as a separate
95
+ cross-view consistency signal, plus the number of source views with any
96
+ support in the fused result.
97
+ It also emits a dependency-free Gaussian-splat PLY initialized from the fused
98
+ points. Splat opacity and initial scale are confidence-weighted, allowing the
99
+ representation to expose uncertainty before any learned Gaussian optimization.
100
+ Each run includes a JSON manifest recording the backend, model, runtime,
101
+ number of views, elapsed time, and generated artifact paths.
102
+ The UI also accepts optional additional images so DA3 can process a small
103
+ multi-view batch in one request; fusion and novel-view synthesis remain
104
+ separate, explicitly tracked stages.
105
+ When the V2 fallback is selected, additional images use a deterministic
106
+ synthetic orbit pose prior and the run manifest records that limitation; only
107
+ DA3 camera metadata is treated as camera-aware geometry.
108
+ Hosted requests are bounded to eight views and a 1536-pixel maximum input side
109
+ by default, with `SIMAM3D_MAX_VIEWS` and `SIMAM3D_MAX_INPUT_SIDE` available for
110
+ controlled deployments. Inference runs under `torch.inference_mode()` to
111
+ avoid retaining training graphs. The heavy inference event is limited to one
112
+ concurrent request and guarded by a process lock, reducing avoidable V2/DA3
113
+ memory contention.
114
+ Fusion resolution is configurable with `SIMAM3D_FUSION_VOXEL_SIZE` (default
115
+ `0.02`) and `SIMAM3D_FUSION_MAX_POINTS` (default `150000`); both values are
116
+ recorded in the run manifest.
117
+ The provenance bitmask supports up to 30 views because it is exported as a
118
+ signed 32-bit integer.
119
+
120
+ The geometry layer is isolated in `simam3d_core.py`, a dependency-free NumPy
121
+ module with deterministic voxel fusion and confidence metrics. Its smoke tests
122
+ can run without CUDA or model weights:
123
+
124
+ ```bash
125
+ python -c "import runpy; ns=runpy.run_path('tests/test_core.py'); [fn() for name,fn in ns.items() if name.startswith('test_')]"
126
+ ```
127
+
128
+ Relative depth is normalized using a consistent inverse-depth convention for
129
+ the current scaffold, so exported geometry is useful for visualization but is
130
+ not yet metrically scaled. DA3 camera calibration and
131
+ multi-view pose quality should be evaluated before treating measurements as
132
+ physical dimensions.
133
+
134
+ ## Planned backends
135
+
136
+ - **Depth Anything 3**: any-view depth, camera pose, confidence, and direct Gaussian estimation.
137
+ - **TRELLIS.2**: primary high-quality mesh and structured-latent backend.
138
+ - **Hunyuan3D 2.1**: alternative shape and PBR-texture backend.
139
+ - **gsplat**: Gaussian initialization, confidence-weighted fusion, and rendering.
140
+
141
+ Extend3D remains a research reference only. Simam3D will use adapters around
142
+ these maintained projects so each backend can be tested independently and
143
+ replaced without rewriting the UI or export layer.
144
+
145
+ ## Companion prototypes
146
+
147
+ - [SimamTwin3D](https://huggingface.co/spaces/junaid-simamdigital/SimamTwin3D):
148
+ consent-first multi-view human-reference capture audit. It records hashes and
149
+ capture coverage; it does not claim a perfect digital twin.
150
+ - [SimamAnything2GS](https://huggingface.co/spaces/junaid-simamdigital/SimamAnything2GS):
151
+ arbitrary image/video ingest with bounded FFmpeg sampling and a CPU 2.5D
152
+ preview. It is an ingest smoke test, not learned 3D reconstruction.
153
+
154
+ These prototypes are intentionally separate so experimental identity/video
155
+ workflows and general Gaussian reconstruction do not weaken Simam3D's evidence
156
+ and provenance contract.
157
+ The falsifiable experiment queue is documented in
158
+ [RESEARCH_BACKLOG.md](RESEARCH_BACKLOG.md).
159
+
160
+ ## SimamDigital publishing
161
+
162
+ The live demo currently belongs to the `junaid-simamdigital` user namespace.
163
+ For prominent company branding, keep this Space linked from the
164
+ [SimamDigital organization](https://huggingface.co/SimamDigital), and later
165
+ move it to `SimamDigital/Simam3D` once the organization profile and collection
166
+ are ready. The `pinned` flag keeps the Space near the top of its owning profile.
167
+
168
+ ## Hosting notes
169
+
170
+ This repository is currently packaged as a Docker Space, so its T4/L4/A10G
171
+ hardware choices are metered Space hardware. Hugging Face ZeroGPU is a
172
+ separate Gradio-SDK-only hosting mode; selecting `zero-a10g` on this Docker
173
+ Space is not a drop-in replacement. A future ZeroGPU variant would need a
174
+ Gradio-SDK packaging pass, the `spaces.GPU` function boundary, and the
175
+ ZeroGPU-supported Torch/Python matrix. The Docker version remains the
176
+ reproducible target for calibrated DA3 experiments.
177
+ The app already includes an optional no-op-safe `spaces.GPU` boundary; it does
178
+ not convert this Docker Space into a ZeroGPU Space by itself.
179
+ See [ZERO_GPU_MIGRATION.md](ZERO_GPU_MIGRATION.md) for the separate-variant
180
+ steps and acceptance checks.
181
+
182
+ ## Roadmap
183
+
184
+ 1. Depth baseline, GLB, PLY, camera metadata, confidence fusion, and Gaussian initialization (implemented).
185
+ 2. Validate DA3NESTED-GIANT-LARGE-1.1 camera-aware and direct-Gaussian outputs against the V2 fallback (camera-aware depth/pose is validated; direct-Gaussian hosted validation remains open).
186
+ 3. Add four-view completion with source-view preservation and confidence-weighted fusion.
187
+ 4. Add TRELLIS.2 and Hunyuan3D backend selection.
188
+ 5. Add gsplat optimization and interactive splat preview.
189
+
190
+ The UI defaults to the V2 stable baseline for a first successful smoke test;
191
+ DA3 remains available as the explicit camera-aware research backend. It is
192
+ optional at build time: the default image installs the stable V2 path, while
193
+ `requirements-da3.txt` can be layered into a research image when the upstream
194
+ DA3 API is known to be compatible. This prevents an experimental Git dependency
195
+ from making the baseline Space fail to build.
196
+ The Dockerfile exposes the same opt-in as
197
+ `--build-arg SIMAM3D_INSTALL_DA3=1` for reproducible GPU research builds.
198
+ The optional DA3 source is pinned to a specific upstream commit rather than
199
+ tracking a moving branch.
200
+ The container also includes a health check for the Gradio HTTP process, so a
201
+ reachable UI can be separated from later model-inference failures.
202
+ Gradio is launched with detailed error display enabled, while the manifest and
203
+ container logs remain the authoritative diagnostic record.
204
+ Failed requests also leave a redacted failure manifest with the failing stage,
205
+ backend, runtime, software versions, input hashes, and exception details for
206
+ reproducible diagnosis.
207
+ The Diagnostics panel can list those reports for download after a failed run.
208
+ The Diagnostics panel checks the optional DA3 package and the expected
209
+ `DepthAnything3` symbol across both known upstream import locations, so an
210
+ installed but incompatible DA3 package is visible before model inference.
211
+ When DA3 is selected, its depth, confidence, extrinsics, and intrinsics shapes
212
+ are validated at the adapter boundary; malformed results trigger the labeled V2
213
+ fallback before any geometry export begins, and the exact fallback exception is
214
+ stored in the run manifest for diagnosis.
215
+ Backend switching also releases the previously loaded heavyweight model before
216
+ loading the next one, reducing avoidable GPU memory pressure in long-lived
217
+ Space processes.
218
+ Additional views accept both filepath strings and Gradio `FileData` uploads;
219
+ unreadable files now produce a direct input error before inference starts.
220
+ The baseline requirements also pin the CUDA-compatible Torch pair and bound
221
+ dependency major versions so rebuilds do not silently change the inference or
222
+ export contract.