Lucasgitguy-co commited on
Commit
1738cdf
·
verified ·
1 Parent(s): 1c1a97e

Release v0.1.0: local Image3D Student prototype under Apache-2.0

Browse files

First public source release with synthetic-only demonstration checkpoint, local CPU/Metal student training, experimental Idol adapter, explicit limitations, third-party notices, and Windows/Linux/macOS guides.

This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitignore +8 -0
  2. CHANGELOG.md +13 -0
  3. LICENSE +202 -0
  4. NOTICE +11 -0
  5. README.md +198 -0
  6. SHA256SUMS +57 -0
  7. THIRD_PARTY.md +18 -0
  8. VERIFICATION.md +40 -0
  9. docs/ALL_MODELS.md +34 -0
  10. docs/USAGE.md +120 -0
  11. examples/synthetic-smoke/README.txt +5 -0
  12. examples/synthetic-smoke/dataset/images/fixture-000.png +0 -0
  13. examples/synthetic-smoke/dataset/images/fixture-001.png +0 -0
  14. examples/synthetic-smoke/dataset/images/fixture-002.png +0 -0
  15. examples/synthetic-smoke/dataset/images/fixture-003.png +0 -0
  16. examples/synthetic-smoke/dataset/images/fixture-004.png +0 -0
  17. examples/synthetic-smoke/dataset/images/fixture-005.png +0 -0
  18. examples/synthetic-smoke/dataset/images/fixture-006.png +0 -0
  19. examples/synthetic-smoke/dataset/images/fixture-007.png +0 -0
  20. examples/synthetic-smoke/dataset/images/fixture-008.png +0 -0
  21. examples/synthetic-smoke/dataset/images/fixture-009.png +0 -0
  22. examples/synthetic-smoke/dataset/images/fixture-010.png +0 -0
  23. examples/synthetic-smoke/dataset/images/fixture-011.png +0 -0
  24. examples/synthetic-smoke/dataset/manifest.jsonl +12 -0
  25. examples/synthetic-smoke/dataset/targets/fixture-000.npz +3 -0
  26. examples/synthetic-smoke/dataset/targets/fixture-001.npz +3 -0
  27. examples/synthetic-smoke/dataset/targets/fixture-002.npz +3 -0
  28. examples/synthetic-smoke/dataset/targets/fixture-003.npz +3 -0
  29. examples/synthetic-smoke/dataset/targets/fixture-004.npz +3 -0
  30. examples/synthetic-smoke/dataset/targets/fixture-005.npz +3 -0
  31. examples/synthetic-smoke/dataset/targets/fixture-006.npz +3 -0
  32. examples/synthetic-smoke/dataset/targets/fixture-007.npz +3 -0
  33. examples/synthetic-smoke/dataset/targets/fixture-008.npz +3 -0
  34. examples/synthetic-smoke/dataset/targets/fixture-009.npz +3 -0
  35. examples/synthetic-smoke/dataset/targets/fixture-010.npz +3 -0
  36. examples/synthetic-smoke/dataset/targets/fixture-011.npz +3 -0
  37. examples/synthetic-smoke/metrics.jsonl +5 -0
  38. examples/synthetic-smoke/run.json +29 -0
  39. examples/synthetic-smoke/student.json +36 -0
  40. examples/synthetic-smoke/student.ply +0 -0
  41. examples/synthetic-smoke/synthetic-only.pt +3 -0
  42. examples/synthetic-smoke/tests.txt +2 -0
  43. examples/synthetic-smoke/turntable.png +0 -0
  44. licenses/Idol-APACHE-2.0.txt +202 -0
  45. pyproject.toml +27 -0
  46. requirements-tested.txt +53 -0
  47. run-local.sh +13 -0
  48. setup.sh +11 -0
  49. src/image3d_student/__init__.py +5 -0
  50. src/image3d_student/cli.py +125 -0
.gitignore ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ .venv/
2
+ __pycache__/
3
+ .pytest_cache/
4
+ *.egg-info/
5
+ data/
6
+ runs/
7
+ vendor/
8
+ .cache/
CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Changelog
2
+
3
+ ## v0.1.0 — 2026-11-02
4
+
5
+ First public release of the local image-to-Gaussian student prototype.
6
+
7
+ - Small FP32 student, cached-target training, held-out validation and standard Gaussian PLY IO.
8
+ - Experimental staged Idol Mac adapter; optional aligned InstantMesh/Hi3D mesh supervision.
9
+ - Windows/Linux CPU recipes and macOS CPU/Metal recipes.
10
+ - Apache-2.0 license and explicit third-party attribution.
11
+ - Synthetic-only demonstration checkpoint, procedural fixtures and verification evidence.
12
+
13
+ No real teacher-trained model, 1-bit inference, full pretrained Idol validation or Mac execution of InstantMesh/Hi3D is claimed.
LICENSE ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
NOTICE ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Image3D Student v0.1.0
2
+ Copyright 2026 Lucasgitguy-co.
3
+
4
+ Original project source, documentation and procedural demonstration artifacts are released under Apache License 2.0.
5
+
6
+ The optional Idol integration and Gaussian attribute conventions were developed with reference to
7
+ speridlabs/idol-sdk, revision 4702a7f00850e34b6e83a2170cc123c3e9570744 (Apache-2.0).
8
+ Its architecture is imported as an optional dependency; pretrained teacher weights are not redistributed.
9
+ Adaptations in this project: staged loading, query-chunk attention, explicit real-valued RoPE selection,
10
+ independent student training, coordinate-preserving Gaussian IO, and diagnostic rendering.
11
+ Upstream attribution is retained in licenses/Idol-APACHE-2.0.txt and THIRD_PARTY.md.
README.md ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language: en
4
+ pipeline_tag: image-to-3d
5
+ tags:
6
+ - pytorch
7
+ - gaussian-splatting
8
+ - distillation
9
+ - research-prototype
10
+ - synthetic-data
11
+ model_name: Image3D Student v0.1.0
12
+ ---
13
+ # Image3D Student v0.1.0 — first public prototype
14
+
15
+ Train a compact image-to-Gaussian-splat student on cached teacher outputs, using Apple Metal or CPU.
16
+
17
+ **First release: v0.1.0 · Apache-2.0.** See [Windows, Linux and macOS instructions](docs/USAGE.md),
18
+ [all publisher model guides](docs/ALL_MODELS.md), [license](LICENSE), [third-party scope](THIRD_PARTY.md),
19
+ and [release notes](CHANGELOG.md).
20
+
21
+ **This is working research code, not a pretrained general-purpose image-to-3D model.**
22
+ The included demonstration checkpoint learned only procedural ellipsoids. It has not learned from Idol,
23
+ InstantMesh or Hi3D and should not be used as evidence of real-image quality.
24
+
25
+ ## What is implemented
26
+
27
+ | Component | Status |
28
+ |---|---|
29
+ | Compact image encoder + coordinate decoder | Implemented, CPU and Metal training tested |
30
+ | Training, object-level validation, metrics and checkpoints | Implemented |
31
+ | Import/export of degree-zero Gaussian PLY | Implemented; preserves position, anisotropic scale, rotation, colour and opacity |
32
+ | Idol supervision | Import its PLY and the exact prepared input image |
33
+ | InstantMesh supervision | Import an aligned coarse triangle mesh as an auxiliary surface-occupancy target |
34
+ | Hi3D supervision | Import an aligned refined triangle mesh as a second auxiliary surface-occupancy target |
35
+ | Running Idol on Mac | Experimental staged adapter; tiny architecture components tested separately; full pretrained pipeline unverified |
36
+ | Running InstantMesh or Hi3D on Mac | **Not implemented**; official GPU implementations need porting |
37
+ | Binary/1-bit student | **Not implemented**; this small baseline uses FP32 |
38
+ | Differentiable rendering / multiview photometric loss | Not implemented in this first baseline |
39
+
40
+ The three-teacher training interface is present, but a fully local way to **generate all three teachers' data**
41
+ is still unresolved. Importing an existing output does not mean the corresponding teacher can run on this Mac.
42
+
43
+ ## Start
44
+
45
+ On the Mac where this project was built, the dependencies are already installed in the working directory.
46
+ From this delivered folder, `bash run-local.sh doctor` reuses that environment. Pass any command described below
47
+ to `bash run-local.sh` instead of `image3d`. On a different machine, use the setup steps below.
48
+
49
+ Use Python 3.11–3.13. From this project directory:
50
+
51
+ ```sh
52
+ bash setup.sh
53
+ source .venv/bin/activate
54
+ image3d doctor
55
+ ```
56
+
57
+ `setup.sh` installs the student dependencies only. It does not download teacher weights.
58
+ `doctor` checks this process's Metal access. Sandboxed terminals can report Metal unavailable even when a normal
59
+ macOS Terminal can use it. Choose `--device mps` to require GPU execution; `auto` may fall back to CPU.
60
+
61
+ ## Run the synthetic pipeline test
62
+
63
+ ```sh
64
+ image3d demo-data --out data/demo --count 12 --grid 8
65
+ image3d train --manifest data/demo/manifest.jsonl --out runs/demo \
66
+ --device mps --width 64 --steps 100 --lr 0.001 --eval-every 25 --allow-synthetic
67
+ image3d generate --checkpoint runs/demo/best.pt \
68
+ --image data/demo/images/fixture-007.png --out runs/demo/student.ply --device mps
69
+ image3d preview --ply runs/demo/student.ply --out runs/demo/turntable.png
70
+ python -m pytest -q
71
+ ```
72
+
73
+ The data split is seeded and groups all samples with the same object ID together. The commands refuse to overwrite
74
+ an existing run or exported PLY. Use a new directory for a new experiment. Ctrl-C saves completed optimizer steps
75
+ to `last.pt`. This version does not resume optimizer training from a checkpoint.
76
+
77
+ With validation enabled, `best.pt` selects the lowest held-out distillation loss. `last.pt` always contains the final
78
+ completed step. With `--validation-fraction 0`, there is no `best.pt` and no generalization measurement.
79
+
80
+ ## Train with real teacher data
81
+
82
+ 1. Supply an image of one centered object and obtain its Idol PLY.
83
+ 2. Cache the **exact input framing seen by Idol**, ideally the `*_input.png` saved by Idol.
84
+ 3. Optionally attach aligned coarse/refined meshes for the same object and image.
85
+ 4. Repeat for a dataset of different objects. Keep related views in the same `--object-id`.
86
+ 5. Train and judge unseen objects, not only training loss.
87
+
88
+ ```sh
89
+ image3d cache --image teacher/item01/input.png --idol-ply teacher/item01/teacher.ply \
90
+ --id item01-view01 --object-id item01 --out data/teachers --grid 16
91
+
92
+ image3d train --manifest data/teachers/manifest.jsonl --out runs/teachers-v1 \
93
+ --device mps --steps 1000 --batch-size 1
94
+
95
+ image3d generate --checkpoint runs/teachers-v1/best.pt \
96
+ --image your-centered-cutout.png --out results/object.ply --device mps
97
+ ```
98
+
99
+ The student does not perform automatic background removal. Use already-framed cutouts, with the object scale
100
+ and orientation matching the training data. RGBA is composited on black, matching Idol's prepared images.
101
+ An arbitrary photo with clutter or different framing is outside the baseline's input contract.
102
+
103
+ ### Attach all three teachers
104
+
105
+ ```sh
106
+ image3d cache --image teacher/item02/input.png --idol-ply teacher/item02/teacher.ply \
107
+ --coarse-mesh teacher/item02/instantmesh.obj --coarse-transform transforms/coarse.json \
108
+ --fine-mesh teacher/item02/hi3d.glb --fine-transform transforms/fine.json \
109
+ --id item02-view01 --object-id item02 --out data/teachers --grid 16
110
+ ```
111
+
112
+ Each transform file is a JSON 4×4 affine matrix mapping mesh coordinates into the **exported Idol PLY coordinate
113
+ frame**. Idol changes its internal z-up frame when exporting PLY; do not apply that rotation twice.
114
+ Only use an identity transform if the assets are already aligned. Example identity:
115
+
116
+ ```json
117
+ [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]
118
+ ```
119
+
120
+ Targets must fit inside `[-0.5,0.5]^3`. Out-of-bounds targets are rejected, not silently normalized.
121
+ Check rotation, scale, translation and camera framing visually before combining teachers. Different teachers can
122
+ hallucinate different unseen geometry. This baseline does **not** automatically align shapes or resolve their disagreements.
123
+
124
+ Geometry losses supervise auxiliary occupancy heads sharing the student features; they do not guarantee that final
125
+ Gaussian surfaces exactly follow the refined mesh. Joint rendering-based supervision and confidence filtering are future work.
126
+
127
+ The manifest stores source labels, transforms, input/target hashes, object IDs and compression counts. A missing teacher
128
+ is masked out of the loss. Do not label fabricated outputs as real teacher supervision.
129
+
130
+ ## Experimental local Idol runner
131
+
132
+ The adapter uses the official Idol architecture at pinned SDK commit
133
+ `4702a7f00850e34b6e83a2170cc123c3e9570744`. It loads background removal, conditioning,
134
+ denoising, octree decoding and Gaussian decoding in stages, deleting models between stages.
135
+ It replaces complex rotary embeddings with the upstream real-valued equivalent and chunks attention along the query
136
+ dimension while retaining all keys/values. CUDA compilation and batched classifier-free guidance are disabled.
137
+
138
+ This reduces simultaneous working memory but **does not establish that full Idol fits in 16 GB**.
139
+ The encoders, their operators, loading peaks and full-size attention still need real-weight testing.
140
+ The runner has no silent CPU operator fallback, so unsupported operations surface as errors.
141
+
142
+ Install code dependencies separately:
143
+
144
+ ```sh
145
+ uv pip install --python .venv/bin/python -e '.[teacher]'
146
+ ```
147
+
148
+ Idol requires access to these gated encoders:
149
+
150
+ - [DINOv3 ViT-H+](https://huggingface.co/facebook/dinov3-vith16plus-pretrain-lvd1689m)
151
+ - [FLUX.2-dev VAE](https://huggingface.co/black-forest-labs/FLUX.2-dev)
152
+
153
+ Accept their terms using your own Hugging Face account. Set the local cache consistently before logging in:
154
+
155
+ ```sh
156
+ export HF_HOME="$PWD/.cache/huggingface"
157
+ hf auth login
158
+
159
+ # Explicitly allows model downloads. Start with a transparent single-object PNG.
160
+ image3d teacher-idol --image your-cutout.png --out teacher/item01 \
161
+ --cache "$HF_HOME" --allow-download --device mps --steps 20 --gaussians 32768
162
+ ```
163
+
164
+ The download command requires 16 GiB of free disk space as a conservative safety margin, not a measured model minimum.
165
+ At build time this Mac had approximately 7.4 GB available before dependency installation, so no model weights were downloaded.
166
+ With a complete existing cache, omit `--allow-download`: the runner then uses local files only.
167
+ 20 steps is a reduced-cost experiment; it is not the teacher's default 50-step quality setting.
168
+ Use `--steps 50` once execution and memory have been verified.
169
+
170
+ ## Architecture and losses
171
+
172
+ The baseline is deliberately small: a four-stage convolutional image encoder produces a shared feature vector.
173
+ A coordinate MLP predicts one Gaussian per cell in a normalized object cube, plus coarse/fine geometry logits.
174
+ The default 16³ grid has at most 4,096 Gaussians; grid 32 has at most 32,768. Grid 8 is for smoke tests.
175
+ An image encoder trained from scratch is not expected to generalize from a handful of examples.
176
+
177
+ When several Idol Gaussians occupy a cell, the cache retains the highest-opacity one.
178
+ This is **lossy compression**, not a fidelity-preserving replacement for the full teacher. It can lose fine geometry,
179
+ transparency and colour. Teacher colours outside display RGB are clipped for student supervision.
180
+
181
+ Training uses balanced cell-occupancy BCE, cell-scaled position error, colour error, log-scale error,
182
+ quaternion sign-invariant rotation error, opacity error, and optional geometry occupancy BCE.
183
+ It uses direct cached-target regression; no CUDA rasterizer is needed for student training.
184
+ The preview renderer is an orthographic CPU diagnostic renderer, not a calibrated quality evaluator.
185
+
186
+ The model's speed comes from its small one-pass architecture, not from copying InstantMesh's speed through a loss.
187
+ Teacher-level quality, real-photo reconstruction, mesh topology and 1-bit compression are not established.
188
+
189
+ ## Reproducibility
190
+
191
+ `requirements-tested.txt` records the environment used for verification; `pyproject.toml` specifies installable dependencies.
192
+ See `VERIFICATION.md` and `examples/synthetic-smoke/` for the delivered test evidence.
193
+ No external GPU or cloud training service was used. Source and Python package downloads did use the internet.
194
+
195
+ Upstream references:
196
+ [InstantMesh](https://github.com/TencentARC/InstantMesh),
197
+ [Hi3D](https://huggingface.co/hi3d-official/Hi3Dv1.0),
198
+ [Idol SDK](https://github.com/speridlabs/idol-sdk).
SHA256SUMS ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 73d65b3243e83752f6ce82a0d277ea6b68a5477db62c6cf5cdb2eae3706a552b .gitignore
2
+ 745360a8340c02c0802b6096d86438eface1206b1d0823638b31647c65fd6b0a CHANGELOG.md
3
+ cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE
4
+ 97f90d4705df2cab9b4e7745e8f91eac89296a6c0efb111aecb7fc23863ac905 NOTICE
5
+ 8f8237ad374e3a45fc4b66504c30e6e4d671cc0a0f78471c5e758b2bbb64a3e3 README.md
6
+ 3afc5f958305e31c116b19e64690543a49b1f787547f1d5f53e52958f511ea4a THIRD_PARTY.md
7
+ 3180b6089fea90fba33dd0e1981e0624bb1c21104aaa8fc5ed7a1cfa02cca983 VERIFICATION.md
8
+ 6ed18e51bf692e882b9b20318721583a1c586922ad02543d2dadb017332f6a8c docs/ALL_MODELS.md
9
+ 7d9b6bb366592cb06e7c2fbc8923af10f42dbce9abb3d6a0c165dda40f407aee docs/USAGE.md
10
+ d37f6f0e5fa95c20ee3e6c78cce997c159fab59aa17b2cd813a01c7c5df96902 examples/synthetic-smoke/README.txt
11
+ 653ce4a780fe09b68831e3474ba16afe3f7d2943e950aee3bf8ce0e0dc415894 examples/synthetic-smoke/dataset/images/fixture-000.png
12
+ 00fe7a4c03fb3ffb5b1dc09ba642017d8204d5b72911550f2834985073781088 examples/synthetic-smoke/dataset/images/fixture-001.png
13
+ d4a62f7ce5ac714e9905de9e446f0db250afbbb981227609f576bdc87e43558c examples/synthetic-smoke/dataset/images/fixture-002.png
14
+ 117cd7e973d94613323e87a538176b6f4b33a74b26e30c52cf7ddb27b699a4f5 examples/synthetic-smoke/dataset/images/fixture-003.png
15
+ 3570b589229609ede457e552668f5b685bbd7271925d3410212dc0797972c31f examples/synthetic-smoke/dataset/images/fixture-004.png
16
+ 942f83d89c753632a77915647d4bf98686aebff08bd674c2ee1e4d22eece1a92 examples/synthetic-smoke/dataset/images/fixture-005.png
17
+ d03a564f9e44223c8c7ef726ad464dbfbfeed7033d3b37b3bf0af0052c029b29 examples/synthetic-smoke/dataset/images/fixture-006.png
18
+ f547698cdd97e60ca8d0eb26ffe0c94660adb8d2a71bf987ac0756ec8c589168 examples/synthetic-smoke/dataset/images/fixture-007.png
19
+ 8409ee247f4fdf4a2c5b31c883f69f3e7939ab4b4015510028078215b55f25db examples/synthetic-smoke/dataset/images/fixture-008.png
20
+ 09d1383e8111fea53a0a27380a88a6ff0419e423eef2edc9a53c1893eae0b162 examples/synthetic-smoke/dataset/images/fixture-009.png
21
+ e0ee306fb0067c16c209ba040fbc24c92c227c5330d353734d55212ebd9bb34a examples/synthetic-smoke/dataset/images/fixture-010.png
22
+ d5eab87569f9134717f2a62985df765f9b9c2baf26238e999f36d7ab26c083c2 examples/synthetic-smoke/dataset/images/fixture-011.png
23
+ fd87f70cab28136979f63e8cf31a391b35f0a794c60cb3ace5a9aefd95a89ce2 examples/synthetic-smoke/dataset/manifest.jsonl
24
+ 14c5faa6a9f3496a77eb8d84d3372c028633c4067c19b34acb2f53500723a84b examples/synthetic-smoke/dataset/targets/fixture-000.npz
25
+ 2c6a8f9acbf991dd1d71e7968c2ee5aae85e8aea88ed130d6ee5c2917bf337bf examples/synthetic-smoke/dataset/targets/fixture-001.npz
26
+ 59559a2a77e854efbebcd679f5e36c94b83a74b3948f94fc71040b01bf2812eb examples/synthetic-smoke/dataset/targets/fixture-002.npz
27
+ 6e02ec7927eb6dc1d3eaab79acb34e5f912c1b44ad0400ee0f88de0ff4ddd4d0 examples/synthetic-smoke/dataset/targets/fixture-003.npz
28
+ 18f8c84baa16107cb7a90513c6d4747aa07efb86e40e05fce174f73bfebe6bce examples/synthetic-smoke/dataset/targets/fixture-004.npz
29
+ 865602b33c998cbba335eee7ac404724520bb7fe894b9145ac5674ce34627f88 examples/synthetic-smoke/dataset/targets/fixture-005.npz
30
+ 978618b66ce7ebaedb6a46d8491b661909009d9ee977ddb3a833b27361419001 examples/synthetic-smoke/dataset/targets/fixture-006.npz
31
+ 6fbd33248e2b1980d091c2b090cd9055a74f241cad63bc1385630374dafbfda1 examples/synthetic-smoke/dataset/targets/fixture-007.npz
32
+ 814a7856c7013f5c8ddb8b0924aefb74952ab1edee3096b8faf75f48fbf1d3c4 examples/synthetic-smoke/dataset/targets/fixture-008.npz
33
+ b1d5e220731f5f07f7e1f92ce13fd9acb7e89451a094dff1c539c9523d33b7b0 examples/synthetic-smoke/dataset/targets/fixture-009.npz
34
+ b2501f9ba86b83f1890d845c513b5b0dfe1683b7cf427eb81f0bc793dc156660 examples/synthetic-smoke/dataset/targets/fixture-010.npz
35
+ cf657e99a12a1fe9d3e232fea187a1128849644dd145dc154f844af581f1a235 examples/synthetic-smoke/dataset/targets/fixture-011.npz
36
+ 179e0d93c4e3fd563c4b77f847b8b452d0da57f97a1970c041e9d576e4f7adb9 examples/synthetic-smoke/metrics.jsonl
37
+ 170aa76fc49fd9486fdaa86e504a2dc56a855a1a6fe6fdadc1aadef1eca072e2 examples/synthetic-smoke/run.json
38
+ 715a1d0583254513ad7922fb78d906afae454f2b67be4729ebff723643ddb3ad examples/synthetic-smoke/student.json
39
+ 333cea620e0c898ed1c2de686842d2dacb6fabb4709d13f67b290d3e77fc2430 examples/synthetic-smoke/student.ply
40
+ dd1a1719541c5603125e7f9379b0ad8ede20b7e9f2816a04e9120244cdbf528e examples/synthetic-smoke/synthetic-only.pt
41
+ 94b812437c181ed7d2de1eea5283c6f813745db74f24d3a73422d11d49217904 examples/synthetic-smoke/tests.txt
42
+ 3a265261c9b999ae5e69a07faa6b30bd894bb8383482ee54440599236810c799 examples/synthetic-smoke/turntable.png
43
+ cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 licenses/Idol-APACHE-2.0.txt
44
+ bc8e9ef80c84c150f9768d0caa5c1d2302267ac98f8193549c73459ae0f8c2c8 pyproject.toml
45
+ ca8882c02bbaf27c4a1c1ee7c050ffa0fd2146466b9572ca25c008acdf11667a requirements-tested.txt
46
+ 3ba5d0afbcf107c5c17e8d9e26b4ccb37bb5c8fec7c9efe5fe3eead58be0c2d6 run-local.sh
47
+ 66016ae8d5b10bde70460d4074a17bddbd357780e4684e9e7ef852c05e65de49 setup.sh
48
+ fb16dba6d7b1fe9d7c63703dfa07f9ba143cc3a24249cdfae6aa86197c22a3a1 src/image3d_student/__init__.py
49
+ d2066dcc48657504460ebf17e0095dbca61eaedd5a0bdd6a99028c87c64563c6 src/image3d_student/cli.py
50
+ d34f9fa50d574764e5e2c1c31c1ca477f2bc4a1887e103c5c47b754f1f1d8c72 src/image3d_student/data.py
51
+ e01d1b42929c993d92cad1bde8944b14c6a8e325fc279d8fd3e9c7287523ad69 src/image3d_student/demo.py
52
+ cf9a610c56faa21a794df111d5ea1c26ba4afe64d307bdadda2eaac9e82aa8de src/image3d_student/engine.py
53
+ a18005f75a66846446b2574b4f1b085ebde5321e835c4e5b4507e15e812ee5ef src/image3d_student/model.py
54
+ 41961fae62d2819c1e3f455e74539a66b8c4f57bedd9fb9379497b3a5764c692 src/image3d_student/splats.py
55
+ 2e2439bc0a48c52e32a8e273f879ed7328fdb82632a996ed3e239e0391ca3a59 src/image3d_student/teacher_idol.py
56
+ 8570a8b6bc79150003eab28c9db117ce3fc7eb6f2cea1d357bdf67e759b541fe tests/test_mps.py
57
+ b9970d623f102e6a88908b425da846700af501b7e3fb976e70d00d8684ad6a1b tests/test_pipeline.py
THIRD_PARTY.md ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # License scope and external components
2
+
3
+ The Apache-2.0 license covers this project's original source, documentation, procedural data and synthetic-only checkpoint.
4
+ It does not replace the terms of third-party packages, pretrained teachers, or separately downloaded encoders.
5
+
6
+ | Component | Treatment |
7
+ |---|---|
8
+ | Idol SDK | Optional dependency pinned to `4702a7f00850e34b6e83a2170cc123c3e9570744`; Apache-2.0 attribution retained |
9
+ | InstantMesh | External teacher reference/import; no upstream weights or implementation bundled |
10
+ | Hi3D v1.0 | External teacher reference/import; its custom license is not replaced by this license |
11
+ | DINOv3 / FLUX.2-dev VAE | Gated, separately downloaded encoder dependencies with their own terms |
12
+ | PyTorch, NumPy, Pillow, SciPy, trimesh, plyfile | Installed dependencies; each retains its own license |
13
+
14
+ The supplied checkpoint was trained on generated ellipsoid fixtures only. It contains no distilled Idol,
15
+ InstantMesh or Hi3D training. A future teacher-trained checkpoint requires its own provenance and license assessment.
16
+
17
+ Sources: [Idol SDK license](https://github.com/speridlabs/idol-sdk/blob/4702a7f00850e34b6e83a2170cc123c3e9570744/LICENSE),
18
+ [Hi3D](https://huggingface.co/hi3d-official/Hi3Dv1.0), [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0).
VERIFICATION.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Verification — 1 November 2026
2
+
3
+ ## Verified locally
4
+
5
+ - Apple Silicon, Python 3.13.18, PyTorch 2.15.0.
6
+ - Metal GPU tensor operations and backward pass work outside the app's filesystem sandbox.
7
+ - 10 CPU tests passed: Gaussian PLY round trip; mesh/point PLY rejection; coordinate bounds;
8
+ deterministic cell selection; cache hash and overwrite protections; aligned geometry target import;
9
+ missing-teacher masking; quaternion sign invariance; query-chunk attention equivalence;
10
+ object-level split integrity; and measurable loss reduction during training.
11
+ - 2 additional Metal tests passed: default 16³ student forward/backward; and the official Idol
12
+ architecture's tiny randomly initialized denoiser/sampler, octree and Gaussian decoder.
13
+ The tiny teacher uses the pinned upstream SDK with the real-valued RoPE / chunked attention adapter.
14
+
15
+ ## End-to-end synthetic smoke test
16
+
17
+ - 12 procedural ellipsoid image/splat pairs. **No teacher-generated samples.**
18
+ - 10 training objects, 2 held-out validation objects; seed 42.
19
+ - Student: grid 8, width 64, 306,321 parameters, FP32.
20
+ - 100 AdamW updates on MPS, batch size 1, learning rate 0.001.
21
+ - Held-out loss: 1.35705 at step 1 → 0.55299 at step 100.
22
+ - Held-out occupancy IoU at step 100: 0.48258.
23
+ - Timed training loop including periodic validation/checkpointing: 6.383 seconds.
24
+ This tiny 8³ fixture test is not a runtime estimate for teacher inference or serious training.
25
+ - Reloaded the saved checkpoint and generated a 40-Gaussian PLY for held-out fixture 007.
26
+ - Inspected the four-view diagnostic PNG. It is a coarse, sparse synthetic result, not a realistic reconstruction.
27
+
28
+ ## Not verified / not completed
29
+
30
+ - No pretrained Idol weights or gated encoder weights were downloaded.
31
+ - No complete real-image Idol inference on MPS; tiny component success does not establish full-size memory feasibility.
32
+ - No InstantMesh or Hi3D inference on Mac. Their outputs can only be imported into the student dataset.
33
+ - No training on real teacher outputs, real-image evaluation, teacher-quality matching, 1-bit weights, or binary kernels.
34
+ - No multiview rendering loss, automatic cross-teacher alignment, or teacher disagreement filtering.
35
+
36
+ At inspection time, only about 7.4 GB of disk was available before installing dependencies.
37
+ The teacher downloader uses a conservative 16 GiB free-space guard for new downloads.
38
+ The user still needs access to DINOv3 and FLUX.2-dev encoder repositories and actual object images/teacher data.
39
+
40
+ The files in `examples/synthetic-smoke` are included for reproducibility, not as pretrained production assets.
docs/ALL_MODELS.md ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # All Lucasgitguy-co model instructions
2
+
3
+ Updated 2026-11-02: 13 existing model repositories plus the new Image3D Student first release.
4
+ Each guide includes installation, exact artifact names, inference steps or explicit platform limitations, and source references.
5
+ Documentation coverage does not imply that every model was executed on every OS.
6
+
7
+ | Model | Step-by-step guide | Weight/project license | Platform status |
8
+ |---|---|---|---|
9
+ | [image3d-student](https://huggingface.co/Lucasgitguy-co/image3d-student) | [Instructions](USAGE.md) | Apache-2.0 | CPU on all three; Metal verified on macOS; synthetic prototype |
10
+ | [lfm3-vl-2b-heretic-gguf](https://huggingface.co/Lucasgitguy-co/lfm3-vl-2b-heretic-gguf) | [Instructions](https://huggingface.co/Lucasgitguy-co/lfm3-vl-2b-heretic-gguf/blob/main/docs/USAGE.md) | LFM Open License v1.0 | Windows / Linux / macOS recipes |
11
+ | [lfm3-vl-2b-heretic](https://huggingface.co/Lucasgitguy-co/lfm3-vl-2b-heretic) | [Instructions](https://huggingface.co/Lucasgitguy-co/lfm3-vl-2b-heretic/blob/main/docs/USAGE.md) | LFM Open License v1.0 | Windows / Linux / macOS recipes |
12
+ | [minimind-3v-moe-adapter](https://huggingface.co/Lucasgitguy-co/minimind-3v-moe-adapter) | [Instructions](https://huggingface.co/Lucasgitguy-co/minimind-3v-moe-adapter/blob/main/docs/USAGE.md) | Apache-2.0 | Base candidate documented; exact original revision unresolved |
13
+ | [minicpm-v-4-7-1b-mermaid-adapter](https://huggingface.co/Lucasgitguy-co/minicpm-v-4-7-1b-mermaid-adapter) | [Instructions](https://huggingface.co/Lucasgitguy-co/minicpm-v-4-7-1b-mermaid-adapter/blob/main/docs/USAGE.md) | Apache-2.0 | Windows / Linux / macOS recipes |
14
+ | [lfm3-vl-2b-heretic-mlx-4bit](https://huggingface.co/Lucasgitguy-co/lfm3-vl-2b-heretic-mlx-4bit) | [Instructions](https://huggingface.co/Lucasgitguy-co/lfm3-vl-2b-heretic-mlx-4bit/blob/main/docs/USAGE.md) | LFM Open License v1.0 | Apple Silicon recipe; no validated Windows/Linux execution for this artifact |
15
+ | [minimind-mermaid-run2](https://huggingface.co/Lucasgitguy-co/minimind-mermaid-run2) | [Instructions](https://huggingface.co/Lucasgitguy-co/minimind-mermaid-run2/blob/main/docs/USAGE.md) | Apache-2.0 | Windows / Linux / macOS recipes |
16
+ | [minicpm-mermaid-heretic](https://huggingface.co/Lucasgitguy-co/minicpm-mermaid-heretic) | [Instructions](https://huggingface.co/Lucasgitguy-co/minicpm-mermaid-heretic/blob/main/docs/USAGE.md) | Apache-2.0 | Windows / Linux / macOS recipes |
17
+ | [minicpm-mermaid-heretic-trial65](https://huggingface.co/Lucasgitguy-co/minicpm-mermaid-heretic-trial65) | [Instructions](https://huggingface.co/Lucasgitguy-co/minicpm-mermaid-heretic-trial65/blob/main/docs/USAGE.md) | Apache-2.0 | Windows / Linux / macOS recipes |
18
+ | [minicpm-mermaid-gguf](https://huggingface.co/Lucasgitguy-co/minicpm-mermaid-gguf) | [Instructions](https://huggingface.co/Lucasgitguy-co/minicpm-mermaid-gguf/blob/main/docs/USAGE.md) | Apache-2.0 | Windows / Linux / macOS recipes |
19
+ | [minicpm-mermaid-heretic-gguf](https://huggingface.co/Lucasgitguy-co/minicpm-mermaid-heretic-gguf) | [Instructions](https://huggingface.co/Lucasgitguy-co/minicpm-mermaid-heretic-gguf/blob/main/docs/USAGE.md) | Apache-2.0 | Windows / Linux / macOS recipes |
20
+ | [minicpm-mermaid-heretic-trial65-gguf](https://huggingface.co/Lucasgitguy-co/minicpm-mermaid-heretic-trial65-gguf) | [Instructions](https://huggingface.co/Lucasgitguy-co/minicpm-mermaid-heretic-trial65-gguf/blob/main/docs/USAGE.md) | Apache-2.0 | Windows / Linux / macOS recipes |
21
+ | [Lucas-Image-2.1-Turbo-Q2K-SakuraEncoder](https://huggingface.co/Lucasgitguy-co/Lucas-Image-2.1-Turbo-Q2K-SakuraEncoder) | [Instructions](https://huggingface.co/Lucasgitguy-co/Lucas-Image-2.1-Turbo-Q2K-SakuraEncoder/blob/main/docs/USAGE.md) | Qwen Research License | Windows / Linux / macOS recipes |
22
+ | [Qwen3.5-2B-Mermaid-MLX-LoRA](https://huggingface.co/Lucasgitguy-co/Qwen3.5-2B-Mermaid-MLX-LoRA) | [Instructions](https://huggingface.co/Lucasgitguy-co/Qwen3.5-2B-Mermaid-MLX-LoRA/blob/main/docs/USAGE.md) | Apache-2.0 | Apple Silicon recipe; no validated Windows/Linux execution for this artifact |
23
+
24
+ ## Related datasets
25
+
26
+ The account also contains [mermaid-diagram-text-images](https://huggingface.co/datasets/Lucasgitguy-co/mermaid-diagram-text-images)
27
+ and [mermaid-text-en-nl](https://huggingface.co/datasets/Lucasgitguy-co/mermaid-text-en-nl). These are datasets, not runnable model modules.
28
+ Their dataset cards describe the data and retain their own terms. Do not combine them into training/evaluation without checking for overlap.
29
+
30
+ ## License boundaries
31
+
32
+ The new Image3D Student original code and synthetic-only artifacts use Apache-2.0. Existing LFM weight releases retain
33
+ LFM Open License v1.0; the Qwen image bundle retains the Qwen Research License. Those inherited terms cannot be replaced
34
+ by labelling the repositories Apache-2.0. Other existing license declarations were preserved.
docs/USAGE.md ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Image3D Student v0.1.0 — Windows, Linux and macOS
2
+
3
+ This is the first public prototype release. The bundled checkpoint learned only synthetic ellipsoids.
4
+ It is useful for testing installation, loading, training and PLY export; it is not a general image-to-3D model.
5
+ Original project code, documentation and synthetic demonstration artifacts are Apache-2.0.
6
+
7
+ Install Python 3.13 (or use 3.11/3.12). Start in a new directory. Windows uses PowerShell.
8
+ CPU is supported by the code on all three platforms; actual execution was verified on macOS CPU and Metal only.
9
+ This version does not implement a CUDA student device. Do not pass `--device cuda`.
10
+
11
+ ## Windows
12
+
13
+ 1. Create an environment and install the Hub downloader.
14
+
15
+ ```powershell
16
+ py -3.13 -m venv .venv
17
+ .\.venv\Scripts\python.exe -m pip install --upgrade pip
18
+ .\.venv\Scripts\python.exe -m pip install huggingface_hub
19
+ ```
20
+
21
+ 2. Download the immutable first release and install its source package.
22
+
23
+ ```powershell
24
+ .\.venv\Scripts\hf.exe download Lucasgitguy-co/image3d-student --revision v0.1.0 --local-dir image3d-student
25
+ .\.venv\Scripts\python.exe -m pip install -e "./image3d-student[test]"
26
+ .\.venv\Scripts\python.exe -m image3d_student.cli doctor
27
+ ```
28
+
29
+ 3. Generate a test PLY using the bundled synthetic-only checkpoint.
30
+
31
+ ```powershell
32
+ .\.venv\Scripts\python.exe -m image3d_student.cli generate --checkpoint image3d-student/examples/synthetic-smoke/synthetic-only.pt --image image3d-student/examples/synthetic-smoke/dataset/images/fixture-007.png --out results/synthetic-demo.ply --device cpu
33
+ .\.venv\Scripts\python.exe -m image3d_student.cli preview --ply results/synthetic-demo.ply --out results/turntable.png
34
+ ```
35
+
36
+ 4. Test training from scratch on procedural fixtures.
37
+
38
+ ```powershell
39
+ .\.venv\Scripts\python.exe -m image3d_student.cli demo-data --out data/demo --count 12 --grid 8
40
+ .\.venv\Scripts\python.exe -m image3d_student.cli train --manifest data/demo/manifest.jsonl --out runs/demo --device cpu --width 64 --steps 100 --lr 0.001 --eval-every 25 --allow-synthetic
41
+ .\.venv\Scripts\python.exe -m pytest image3d-student/tests -q
42
+ ```
43
+ ## Linux
44
+
45
+ 1. Create an environment and install the Hub downloader.
46
+
47
+ ```bash
48
+ python3.13 -m venv .venv
49
+ .venv/bin/python -m pip install --upgrade pip
50
+ .venv/bin/python -m pip install huggingface_hub
51
+ ```
52
+
53
+ 2. Download the immutable first release and install its source package.
54
+
55
+ ```bash
56
+ .venv/bin/hf download Lucasgitguy-co/image3d-student --revision v0.1.0 --local-dir image3d-student
57
+ .venv/bin/python -m pip install -e "./image3d-student[test]"
58
+ .venv/bin/python -m image3d_student.cli doctor
59
+ ```
60
+
61
+ 3. Generate a test PLY using the bundled synthetic-only checkpoint.
62
+
63
+ ```bash
64
+ .venv/bin/python -m image3d_student.cli generate --checkpoint image3d-student/examples/synthetic-smoke/synthetic-only.pt --image image3d-student/examples/synthetic-smoke/dataset/images/fixture-007.png --out results/synthetic-demo.ply --device cpu
65
+ .venv/bin/python -m image3d_student.cli preview --ply results/synthetic-demo.ply --out results/turntable.png
66
+ ```
67
+
68
+ 4. Test training from scratch on procedural fixtures.
69
+
70
+ ```bash
71
+ .venv/bin/python -m image3d_student.cli demo-data --out data/demo --count 12 --grid 8
72
+ .venv/bin/python -m image3d_student.cli train --manifest data/demo/manifest.jsonl --out runs/demo --device cpu --width 64 --steps 100 --lr 0.001 --eval-every 25 --allow-synthetic
73
+ .venv/bin/python -m pytest image3d-student/tests -q
74
+ ```
75
+ ## macOS
76
+
77
+ 1. Create an environment and install the Hub downloader.
78
+
79
+ ```bash
80
+ python3.13 -m venv .venv
81
+ .venv/bin/python -m pip install --upgrade pip
82
+ .venv/bin/python -m pip install huggingface_hub
83
+ ```
84
+
85
+ 2. Download the immutable first release and install its source package.
86
+
87
+ ```bash
88
+ .venv/bin/hf download Lucasgitguy-co/image3d-student --revision v0.1.0 --local-dir image3d-student
89
+ .venv/bin/python -m pip install -e "./image3d-student[test]"
90
+ .venv/bin/python -m image3d_student.cli doctor
91
+ ```
92
+
93
+ 3. Generate a test PLY using the bundled synthetic-only checkpoint.
94
+
95
+ ```bash
96
+ .venv/bin/python -m image3d_student.cli generate --checkpoint image3d-student/examples/synthetic-smoke/synthetic-only.pt --image image3d-student/examples/synthetic-smoke/dataset/images/fixture-007.png --out results/synthetic-demo.ply --device mps
97
+ .venv/bin/python -m image3d_student.cli preview --ply results/synthetic-demo.ply --out results/turntable.png
98
+ ```
99
+
100
+ 4. Test training from scratch on procedural fixtures.
101
+
102
+ ```bash
103
+ .venv/bin/python -m image3d_student.cli demo-data --out data/demo --count 12 --grid 8
104
+ .venv/bin/python -m image3d_student.cli train --manifest data/demo/manifest.jsonl --out runs/demo --device mps --width 64 --steps 100 --lr 0.001 --eval-every 25 --allow-synthetic
105
+ .venv/bin/python -m pytest image3d-student/tests -q
106
+ ```
107
+
108
+ On Intel Macs, or when Metal is unavailable, replace `--device mps` with `--device cpu`.
109
+
110
+ ## Train on real teacher outputs
111
+
112
+ Use the [project workflow](../README.md#train-with-real-teacher-data) to cache the exact teacher input image and Idol PLY, optionally adding explicitly aligned InstantMesh/Hi3D meshes. Use a new run/output directory for each experiment. These models are not downloaded or run by the student training command.
113
+
114
+ Only the experimental Idol runner exists in this release. Full pretrained Idol inference remains unverified; InstantMesh/Hi3D are import-only integrations. The Mac adapter is not a validated Windows/Linux teacher runner. All upstream model/encoder licenses and access terms remain separate from this prototype's Apache license.
115
+
116
+ ## Version and outputs
117
+
118
+ `v0.1.0` pins this first release. Downloading `main` instead may fetch later changes. The `.ply` file is a Gaussian-splat artifact, not a triangle mesh. `last.pt` is the latest training checkpoint; `best.pt` exists only when held-out validation is enabled. Outputs refuse overwriting: choose a new filename/directory when rerunning.
119
+
120
+ No 1-bit quantization is implemented. The default untrained architecture has 465,041 parameters; the bundled smaller smoke-test checkpoint has 306,321 parameters. See [verification](../VERIFICATION.md) for the exact test conditions.
examples/synthetic-smoke/README.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ SYNTHETIC FIXTURES ONLY. No Idol, InstantMesh or Hi3D data was used.
2
+ The checkpoint has only learned 10 procedural ellipsoid objects.
3
+ See ../../VERIFICATION.md.
4
+ To reproduce inference from the project directory:
5
+ bash run-local.sh generate --checkpoint examples/synthetic-smoke/synthetic-only.pt --image examples/synthetic-smoke/dataset/images/fixture-007.png --out results/demo.ply --device mps
examples/synthetic-smoke/dataset/images/fixture-000.png ADDED
examples/synthetic-smoke/dataset/images/fixture-001.png ADDED
examples/synthetic-smoke/dataset/images/fixture-002.png ADDED
examples/synthetic-smoke/dataset/images/fixture-003.png ADDED
examples/synthetic-smoke/dataset/images/fixture-004.png ADDED
examples/synthetic-smoke/dataset/images/fixture-005.png ADDED
examples/synthetic-smoke/dataset/images/fixture-006.png ADDED
examples/synthetic-smoke/dataset/images/fixture-007.png ADDED
examples/synthetic-smoke/dataset/images/fixture-008.png ADDED
examples/synthetic-smoke/dataset/images/fixture-009.png ADDED
examples/synthetic-smoke/dataset/images/fixture-010.png ADDED
examples/synthetic-smoke/dataset/images/fixture-011.png ADDED
examples/synthetic-smoke/dataset/manifest.jsonl ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"id": "fixture-000", "image": "images/fixture-000.png", "target": "targets/fixture-000.npz", "source": "synthetic", "grid": 8, "teachers": {"appearance": "synthetic", "coarse": null, "fine": null}, "teacher_gaussians": 392, "retained_gaussians": 80, "geometry_transforms": {"coarse": null, "fine": null}, "metadata": {"purpose": "code verification only", "object_id": "fixture-000"}, "image_sha256": "653ce4a780fe09b68831e3474ba16afe3f7d2943e950aee3bf8ce0e0dc415894", "target_sha256": "14c5faa6a9f3496a77eb8d84d3372c028633c4067c19b34acb2f53500723a84b"}
2
+ {"id": "fixture-001", "image": "images/fixture-001.png", "target": "targets/fixture-001.npz", "source": "synthetic", "grid": 8, "teachers": {"appearance": "synthetic", "coarse": null, "fine": null}, "teacher_gaussians": 392, "retained_gaussians": 72, "geometry_transforms": {"coarse": null, "fine": null}, "metadata": {"purpose": "code verification only", "object_id": "fixture-001"}, "image_sha256": "00fe7a4c03fb3ffb5b1dc09ba642017d8204d5b72911550f2834985073781088", "target_sha256": "2c6a8f9acbf991dd1d71e7968c2ee5aae85e8aea88ed130d6ee5c2917bf337bf"}
3
+ {"id": "fixture-002", "image": "images/fixture-002.png", "target": "targets/fixture-002.npz", "source": "synthetic", "grid": 8, "teachers": {"appearance": "synthetic", "coarse": null, "fine": null}, "teacher_gaussians": 392, "retained_gaussians": 76, "geometry_transforms": {"coarse": null, "fine": null}, "metadata": {"purpose": "code verification only", "object_id": "fixture-002"}, "image_sha256": "d4a62f7ce5ac714e9905de9e446f0db250afbbb981227609f576bdc87e43558c", "target_sha256": "59559a2a77e854efbebcd679f5e36c94b83a74b3948f94fc71040b01bf2812eb"}
4
+ {"id": "fixture-003", "image": "images/fixture-003.png", "target": "targets/fixture-003.npz", "source": "synthetic", "grid": 8, "teachers": {"appearance": "synthetic", "coarse": null, "fine": null}, "teacher_gaussians": 392, "retained_gaussians": 40, "geometry_transforms": {"coarse": null, "fine": null}, "metadata": {"purpose": "code verification only", "object_id": "fixture-003"}, "image_sha256": "117cd7e973d94613323e87a538176b6f4b33a74b26e30c52cf7ddb27b699a4f5", "target_sha256": "6e02ec7927eb6dc1d3eaab79acb34e5f912c1b44ad0400ee0f88de0ff4ddd4d0"}
5
+ {"id": "fixture-004", "image": "images/fixture-004.png", "target": "targets/fixture-004.npz", "source": "synthetic", "grid": 8, "teachers": {"appearance": "synthetic", "coarse": null, "fine": null}, "teacher_gaussians": 392, "retained_gaussians": 80, "geometry_transforms": {"coarse": null, "fine": null}, "metadata": {"purpose": "code verification only", "object_id": "fixture-004"}, "image_sha256": "3570b589229609ede457e552668f5b685bbd7271925d3410212dc0797972c31f", "target_sha256": "18f8c84baa16107cb7a90513c6d4747aa07efb86e40e05fce174f73bfebe6bce"}
6
+ {"id": "fixture-005", "image": "images/fixture-005.png", "target": "targets/fixture-005.npz", "source": "synthetic", "grid": 8, "teachers": {"appearance": "synthetic", "coarse": null, "fine": null}, "teacher_gaussians": 392, "retained_gaussians": 80, "geometry_transforms": {"coarse": null, "fine": null}, "metadata": {"purpose": "code verification only", "object_id": "fixture-005"}, "image_sha256": "942f83d89c753632a77915647d4bf98686aebff08bd674c2ee1e4d22eece1a92", "target_sha256": "865602b33c998cbba335eee7ac404724520bb7fe894b9145ac5674ce34627f88"}
7
+ {"id": "fixture-006", "image": "images/fixture-006.png", "target": "targets/fixture-006.npz", "source": "synthetic", "grid": 8, "teachers": {"appearance": "synthetic", "coarse": null, "fine": null}, "teacher_gaussians": 392, "retained_gaussians": 64, "geometry_transforms": {"coarse": null, "fine": null}, "metadata": {"purpose": "code verification only", "object_id": "fixture-006"}, "image_sha256": "d03a564f9e44223c8c7ef726ad464dbfbfeed7033d3b37b3bf0af0052c029b29", "target_sha256": "978618b66ce7ebaedb6a46d8491b661909009d9ee977ddb3a833b27361419001"}
8
+ {"id": "fixture-007", "image": "images/fixture-007.png", "target": "targets/fixture-007.npz", "source": "synthetic", "grid": 8, "teachers": {"appearance": "synthetic", "coarse": null, "fine": null}, "teacher_gaussians": 392, "retained_gaussians": 48, "geometry_transforms": {"coarse": null, "fine": null}, "metadata": {"purpose": "code verification only", "object_id": "fixture-007"}, "image_sha256": "f547698cdd97e60ca8d0eb26ffe0c94660adb8d2a71bf987ac0756ec8c589168", "target_sha256": "6fbd33248e2b1980d091c2b090cd9055a74f241cad63bc1385630374dafbfda1"}
9
+ {"id": "fixture-008", "image": "images/fixture-008.png", "target": "targets/fixture-008.npz", "source": "synthetic", "grid": 8, "teachers": {"appearance": "synthetic", "coarse": null, "fine": null}, "teacher_gaussians": 392, "retained_gaussians": 84, "geometry_transforms": {"coarse": null, "fine": null}, "metadata": {"purpose": "code verification only", "object_id": "fixture-008"}, "image_sha256": "8409ee247f4fdf4a2c5b31c883f69f3e7939ab4b4015510028078215b55f25db", "target_sha256": "814a7856c7013f5c8ddb8b0924aefb74952ab1edee3096b8faf75f48fbf1d3c4"}
10
+ {"id": "fixture-009", "image": "images/fixture-009.png", "target": "targets/fixture-009.npz", "source": "synthetic", "grid": 8, "teachers": {"appearance": "synthetic", "coarse": null, "fine": null}, "teacher_gaussians": 392, "retained_gaussians": 64, "geometry_transforms": {"coarse": null, "fine": null}, "metadata": {"purpose": "code verification only", "object_id": "fixture-009"}, "image_sha256": "09d1383e8111fea53a0a27380a88a6ff0419e423eef2edc9a53c1893eae0b162", "target_sha256": "b1d5e220731f5f07f7e1f92ce13fd9acb7e89451a094dff1c539c9523d33b7b0"}
11
+ {"id": "fixture-010", "image": "images/fixture-010.png", "target": "targets/fixture-010.npz", "source": "synthetic", "grid": 8, "teachers": {"appearance": "synthetic", "coarse": null, "fine": null}, "teacher_gaussians": 392, "retained_gaussians": 40, "geometry_transforms": {"coarse": null, "fine": null}, "metadata": {"purpose": "code verification only", "object_id": "fixture-010"}, "image_sha256": "e0ee306fb0067c16c209ba040fbc24c92c227c5330d353734d55212ebd9bb34a", "target_sha256": "b2501f9ba86b83f1890d845c513b5b0dfe1683b7cf427eb81f0bc793dc156660"}
12
+ {"id": "fixture-011", "image": "images/fixture-011.png", "target": "targets/fixture-011.npz", "source": "synthetic", "grid": 8, "teachers": {"appearance": "synthetic", "coarse": null, "fine": null}, "teacher_gaussians": 392, "retained_gaussians": 72, "geometry_transforms": {"coarse": null, "fine": null}, "metadata": {"purpose": "code verification only", "object_id": "fixture-011"}, "image_sha256": "d5eab87569f9134717f2a62985df765f9b9c2baf26238e999f36d7ab26c083c2", "target_sha256": "cf657e99a12a1fe9d3e232fea187a1128849644dd145dc154f844af581f1a235"}
examples/synthetic-smoke/dataset/targets/fixture-000.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:14c5faa6a9f3496a77eb8d84d3372c028633c4067c19b34acb2f53500723a84b
3
+ size 3732
examples/synthetic-smoke/dataset/targets/fixture-001.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c6a8f9acbf991dd1d71e7968c2ee5aae85e8aea88ed130d6ee5c2917bf337bf
3
+ size 3701
examples/synthetic-smoke/dataset/targets/fixture-002.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:59559a2a77e854efbebcd679f5e36c94b83a74b3948f94fc71040b01bf2812eb
3
+ size 3732
examples/synthetic-smoke/dataset/targets/fixture-003.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6e02ec7927eb6dc1d3eaab79acb34e5f912c1b44ad0400ee0f88de0ff4ddd4d0
3
+ size 3431
examples/synthetic-smoke/dataset/targets/fixture-004.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18f8c84baa16107cb7a90513c6d4747aa07efb86e40e05fce174f73bfebe6bce
3
+ size 3750
examples/synthetic-smoke/dataset/targets/fixture-005.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:865602b33c998cbba335eee7ac404724520bb7fe894b9145ac5674ce34627f88
3
+ size 3728
examples/synthetic-smoke/dataset/targets/fixture-006.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:978618b66ce7ebaedb6a46d8491b661909009d9ee977ddb3a833b27361419001
3
+ size 3746
examples/synthetic-smoke/dataset/targets/fixture-007.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6fbd33248e2b1980d091c2b090cd9055a74f241cad63bc1385630374dafbfda1
3
+ size 3554
examples/synthetic-smoke/dataset/targets/fixture-008.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:814a7856c7013f5c8ddb8b0924aefb74952ab1edee3096b8faf75f48fbf1d3c4
3
+ size 3814
examples/synthetic-smoke/dataset/targets/fixture-009.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b1d5e220731f5f07f7e1f92ce13fd9acb7e89451a094dff1c539c9523d33b7b0
3
+ size 3670
examples/synthetic-smoke/dataset/targets/fixture-010.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2501f9ba86b83f1890d845c513b5b0dfe1683b7cf427eb81f0bc793dc156660
3
+ size 3437
examples/synthetic-smoke/dataset/targets/fixture-011.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf657e99a12a1fe9d3e232fea187a1128849644dd145dc154f844af581f1a235
3
+ size 3761
examples/synthetic-smoke/metrics.jsonl ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {"step": 1, "seconds": 4.36, "train_loss": 1.446029543876648, "occupancy": 1.1178711652755737, "position": 0.09457678347826004, "colour": 0.03700888156890869, "scale": 0.021625641733407974, "rotation": 0.0015759735833853483, "opacity": 0.15724360942840576, "geometry": -0.0, "validation": {"occupancy": 1.0542445182800293, "position": 0.11266224458813667, "colour": 0.02881160657852888, "scale": 0.021875507198274136, "rotation": 0.011832301504909992, "opacity": 0.1291448101401329, "geometry": 0.0, "loss": 1.357045590877533, "occupancy_iou": 0.0}}
2
+ {"step": 25, "seconds": 4.899, "train_loss": 0.8945547938346863, "occupancy": 0.6847372651100159, "position": 0.11709830909967422, "colour": 0.04580960050225258, "scale": 0.0055952477268874645, "rotation": 0.004777997732162476, "opacity": 6.272108294069767e-05, "geometry": 0.0, "validation": {"occupancy": 0.6845944821834564, "position": 0.10255199298262596, "colour": 0.01412782957777381, "scale": 0.008690122980624437, "rotation": 0.00476150750182569, "opacity": 5.126132509758463e-05, "geometry": 0.0, "loss": 0.8167985677719116, "occupancy_iou": 0.13314673863351345}}
3
+ {"step": 50, "seconds": 5.301, "train_loss": 0.804593563079834, "occupancy": 0.6701697111129761, "position": 0.10525131225585938, "colour": 0.014356697909533978, "scale": 0.0017124137375503778, "rotation": 0.0019470214610919356, "opacity": 9.318323282059282e-05, "geometry": 0.0, "validation": {"occupancy": 0.657372236251831, "position": 0.10001565888524055, "colour": 0.013939401600509882, "scale": 0.0034465506905689836, "rotation": 0.0037114854203537107, "opacity": 8.069136629273999e-05, "geometry": 0.0, "loss": 0.7860631942749023, "occupancy_iou": 0.3602825775742531}}
4
+ {"step": 75, "seconds": 5.847, "train_loss": 0.6927299499511719, "occupancy": 0.5821881890296936, "position": 0.08322491496801376, "colour": 0.012623971328139305, "scale": 0.015208232216536999, "rotation": 0.0022862323094159365, "opacity": 0.0003194920136593282, "geometry": 0.0, "validation": {"occupancy": 0.6055956184864044, "position": 0.09585224837064743, "colour": 0.013855834025889635, "scale": 0.005587705178186297, "rotation": 0.004499655216932297, "opacity": 0.0020019400981254876, "geometry": 0.0, "loss": 0.7321702241897583, "occupancy_iou": 0.15090909227728844}}
5
+ {"step": 100, "seconds": 6.383, "train_loss": 0.513293981552124, "occupancy": 0.38297760486602783, "position": 0.10490132123231888, "colour": 0.011903365142643452, "scale": 0.01172574982047081, "rotation": 0.00287768617272377, "opacity": 0.00014796240429859608, "geometry": 0.0, "validation": {"occupancy": 0.42350494861602783, "position": 0.0950610339641571, "colour": 0.015541733242571354, "scale": 0.029876035638153553, "rotation": 0.0022482963977381587, "opacity": 0.00012832072752644308, "geometry": 0.0, "loss": 0.5529901683330536, "occupancy_iou": 0.4825790077447891}}
examples/synthetic-smoke/run.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "synthetic_only": true,
3
+ "contains_synthetic": true,
4
+ "device": "mps",
5
+ "torch": "2.15.0",
6
+ "seed": 42,
7
+ "train_ids": [
8
+ "fixture-002",
9
+ "fixture-008",
10
+ "fixture-009",
11
+ "fixture-006",
12
+ "fixture-011",
13
+ "fixture-003",
14
+ "fixture-004",
15
+ "fixture-000",
16
+ "fixture-001",
17
+ "fixture-010"
18
+ ],
19
+ "val_ids": [
20
+ "fixture-007",
21
+ "fixture-005"
22
+ ],
23
+ "parameters": 306321,
24
+ "teachers": [
25
+ "synthetic"
26
+ ],
27
+ "validation": "held-out objects",
28
+ "dataset": "examples/synthetic-smoke/dataset/manifest.jsonl"
29
+ }
examples/synthetic-smoke/student.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "gaussians": 40,
3
+ "seconds_preprocess_and_forward": 1.8782236250117421,
4
+ "device": "mps",
5
+ "checkpoint_step": 100,
6
+ "training": {
7
+ "synthetic_only": true,
8
+ "contains_synthetic": true,
9
+ "device": "mps",
10
+ "torch": "2.15.0",
11
+ "seed": 42,
12
+ "train_ids": [
13
+ "fixture-002",
14
+ "fixture-008",
15
+ "fixture-009",
16
+ "fixture-006",
17
+ "fixture-011",
18
+ "fixture-003",
19
+ "fixture-004",
20
+ "fixture-000",
21
+ "fixture-001",
22
+ "fixture-010"
23
+ ],
24
+ "val_ids": [
25
+ "fixture-007",
26
+ "fixture-005"
27
+ ],
28
+ "parameters": 306321,
29
+ "teachers": [
30
+ "synthetic"
31
+ ],
32
+ "validation": "held-out objects",
33
+ "dataset": "examples/synthetic-smoke/dataset/manifest.jsonl"
34
+ },
35
+ "note": "Synthetic-trained output is a pipeline demonstration, not a pretrained image-to-3D result."
36
+ }
examples/synthetic-smoke/student.ply ADDED
Binary file (3.13 kB). View file
 
examples/synthetic-smoke/synthetic-only.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dd1a1719541c5603125e7f9379b0ad8ede20b7e9f2816a04e9120244cdbf528e
3
+ size 1296253
examples/synthetic-smoke/tests.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ............ [100%]
2
+ 12 passed in 7.79s
examples/synthetic-smoke/turntable.png ADDED
licenses/Idol-APACHE-2.0.txt ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
pyproject.toml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "image3d-student"
7
+ version = "0.1.0"
8
+ license = "Apache-2.0"
9
+ license-files = ["LICENSE", "NOTICE", "THIRD_PARTY.md", "licenses/*.txt"]
10
+ readme = "README.md"
11
+ authors = [{name = "Lucasgitguy-co"}]
12
+ description = "Experimental local image-to-Gaussian student with cached teacher supervision"
13
+ requires-python = ">=3.11,<3.14"
14
+ dependencies = ["torch>=2.5", "numpy>=1.26", "pillow>=10", "plyfile>=1", "trimesh>=4", "scipy>=1.11"]
15
+
16
+ [project.optional-dependencies]
17
+ test = ["pytest>=8"]
18
+ teacher = ["idol @ git+https://github.com/speridlabs/idol-sdk.git@4702a7f00850e34b6e83a2170cc123c3e9570744"]
19
+
20
+ [project.scripts]
21
+ image3d = "image3d_student.cli:main"
22
+
23
+ [tool.setuptools.packages.find]
24
+ where = ["src"]
25
+
26
+ [tool.pytest.ini_options]
27
+ testpaths = ["tests"]
requirements-tested.txt ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ annotated-doc==0.0.5
2
+ anyio==4.16.0
3
+ certifi==2026.10.23
4
+ charset-normalizer==3.5.2
5
+ click==8.5.0
6
+ cloudpickle==3.1.2
7
+ diffusers==0.42.1
8
+ filelock==4.2.6
9
+ fsspec==2026.9.0
10
+ h11==0.16.0
11
+ hf-xet==1.8.0
12
+ httpcore2==2.16.0
13
+ httpx2==2.16.0
14
+ huggingface-hub==2.4.0
15
+ idna==3.20
16
+ idol @ git+https://github.com/speridlabs/idol-sdk.git@4702a7f00850e34b6e83a2170cc123c3e9570744
17
+ importlib-metadata==10.1.0
18
+ iniconfig==2.3.1
19
+ jinja2==3.1.6
20
+ markdown-it-py==4.2.0
21
+ markupsafe==3.0.4
22
+ mdurl==0.1.2
23
+ mpmath==1.3.0
24
+ networkx==3.7
25
+ numpy==2.5.4
26
+ packaging==26.3
27
+ pillow==13.0.0
28
+ pluggy==1.7.0
29
+ plyfile==1.1.5
30
+ pygments==2.21.0
31
+ pytest==9.2.0
32
+ pyvers==0.2.3
33
+ pyyaml==6.0.3
34
+ regex==2026.9.29
35
+ requests==2.34.2
36
+ rich==15.0.0
37
+ safetensors==0.8.0
38
+ scipy==1.18.1
39
+ setuptools==84.2.1
40
+ shellingham==1.5.4
41
+ sympy==1.14.0
42
+ tensordict==0.15.4
43
+ tokenizers==0.23.3
44
+ torch==2.15.0
45
+ torchvision==0.29.2
46
+ tqdm==4.70.1
47
+ transformers==5.22.1
48
+ trimesh==5.2.0
49
+ truststore==0.10.5
50
+ typer==0.27.3
51
+ typing-extensions==4.16.0
52
+ urllib3==2.8.0
53
+ zipp==4.1.2
run-local.sh ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd "$(dirname "$0")"
4
+ if [ -x .venv/bin/python ]; then
5
+ exec .venv/bin/python -m image3d_student.cli "$@"
6
+ fi
7
+ # Reuse the environment installed during this chat when running in the delivered outputs folder.
8
+ if [ -x ../../work/image3d-student/.venv/bin/python ]; then
9
+ export PYTHONPATH="$PWD/src${PYTHONPATH:+:$PYTHONPATH}"
10
+ exec ../../work/image3d-student/.venv/bin/python -m image3d_student.cli "$@"
11
+ fi
12
+ echo "No local environment found. Run bash setup.sh first."
13
+ exit 1
setup.sh ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd "$(dirname "$0")"
4
+ export UV_CACHE_DIR="$PWD/.cache/uv"
5
+ if ! command -v uv >/dev/null 2>&1; then
6
+ echo "Install uv or create a Python 3.11–3.13 virtual environment and run: python -m pip install -e '.[test]'"
7
+ exit 1
8
+ fi
9
+ uv venv --python 3.13 .venv
10
+ uv pip install --python .venv/bin/python -e '.[test]'
11
+ echo "Ready. Run: source .venv/bin/activate && image3d doctor"
src/image3d_student/__init__.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright 2026 Lucasgitguy-co
3
+ """Research prototype; no pretrained general-purpose student weights are bundled."""
4
+
5
+ __version__ = "0.1.0"
src/image3d_student/cli.py ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright 2026 Lucasgitguy-co
3
+ import argparse
4
+ import importlib.util
5
+ import json
6
+ import platform
7
+ import shutil
8
+ import sys
9
+ from pathlib import Path
10
+
11
+ import torch
12
+
13
+
14
+ def parser():
15
+ p = argparse.ArgumentParser(description="Local image-to-Gaussian student research prototype")
16
+ sub = p.add_subparsers(dest="command", required=True)
17
+ sub.add_parser("doctor", help="Check dependencies, Metal availability and disk space; no downloads")
18
+ demo = sub.add_parser("demo-data", help="Create synthetic code-test fixtures, NOT teacher data")
19
+ demo.add_argument("--out", required=True)
20
+ demo.add_argument("--count", type=int, default=12)
21
+ demo.add_argument("--grid", type=int, choices=[8,16,32], default=8)
22
+ cache = sub.add_parser("cache", help="Cache Idol PLY with optional aligned geometry teacher meshes")
23
+ cache.add_argument("--image", required=True, help="Exact prepared/framed input used by teacher")
24
+ cache.add_argument("--idol-ply", required=True)
25
+ cache.add_argument("--out", required=True)
26
+ cache.add_argument("--id", required=True)
27
+ cache.add_argument("--object-id", help="Shared ID for all images of the same object, to prevent validation leakage")
28
+ cache.add_argument("--grid", type=int, choices=[8,16,32], default=16)
29
+ cache.add_argument("--coarse-mesh", help="InstantMesh output; this command imports, does not run InstantMesh")
30
+ cache.add_argument("--coarse-transform", help="JSON 4x4 mesh-to-Idol-PLY matrix")
31
+ cache.add_argument("--fine-mesh", help="Hi3D output; this command imports, does not run Hi3D")
32
+ cache.add_argument("--fine-transform", help="JSON 4x4 mesh-to-Idol-PLY matrix")
33
+ train = sub.add_parser("train", help="Train the student on cached targets")
34
+ train.add_argument("--manifest", required=True)
35
+ train.add_argument("--out", required=True)
36
+ train.add_argument("--device", choices=["auto","mps","cpu"], default="auto")
37
+ train.add_argument("--steps", type=int, default=1000)
38
+ train.add_argument("--batch-size", type=int, default=1)
39
+ train.add_argument("--width", type=int, default=128)
40
+ train.add_argument("--lr", type=float, default=3e-4)
41
+ train.add_argument("--seed", type=int, default=42)
42
+ train.add_argument("--eval-every", type=int, default=50)
43
+ train.add_argument("--validation-fraction", type=float, default=.2)
44
+ train.add_argument("--allow-synthetic", action="store_true")
45
+ generate = sub.add_parser("generate", help="Generate standard 3DGS PLY with a trained student")
46
+ generate.add_argument("--checkpoint", required=True)
47
+ generate.add_argument("--image", required=True, help="Centered cutout or teacher-prepared image, black background")
48
+ generate.add_argument("--out", required=True)
49
+ generate.add_argument("--device", choices=["auto","mps","cpu"], default="auto")
50
+ generate.add_argument("--threshold", type=float, default=.5)
51
+ generate.add_argument("--max-splats", type=int, default=32768)
52
+ render = sub.add_parser("preview", help="CPU diagnostic turntable contact sheet")
53
+ render.add_argument("--ply", required=True)
54
+ render.add_argument("--out", required=True)
55
+ teacher = sub.add_parser("teacher-idol", help="EXPERIMENTAL staged Mac runner; weights not bundled")
56
+ teacher.add_argument("--image", required=True)
57
+ teacher.add_argument("--out", required=True)
58
+ teacher.add_argument("--cache", default=".cache/huggingface")
59
+ teacher.add_argument("--weights", default="speridlabs/idol")
60
+ teacher.add_argument("--device", choices=["mps","cpu"], default="mps")
61
+ teacher.add_argument("--mode", choices=["real","synthetic"], default="synthetic")
62
+ teacher.add_argument("--steps", type=int, default=20)
63
+ teacher.add_argument("--gaussians", type=int, default=32768)
64
+ teacher.add_argument("--query-chunk", type=int, default=128)
65
+ teacher.add_argument("--seed", type=int, default=42)
66
+ teacher.add_argument("--allow-download", action="store_true", help="Explicitly allow downloading model weights and gated encoders")
67
+ return p
68
+
69
+
70
+ def main():
71
+ p = parser()
72
+ args = p.parse_args()
73
+ try:
74
+ if args.command == "doctor":
75
+ report = {"python": platform.python_version(), "platform": platform.platform(), "torch": str(torch.__version__),
76
+ "mps_available": torch.backends.mps.is_available(), "mps_built": torch.backends.mps.is_built(),
77
+ "free_disk_gib": round(shutil.disk_usage(Path.cwd()).free / 1024**3, 2),
78
+ "idol_installed": importlib.util.find_spec("idol") is not None,
79
+ "teacher_status": {"Idol": "experimental adapter, real weights unverified",
80
+ "InstantMesh": "cached mesh import only; no Mac execution adapter",
81
+ "Hi3D": "cached mesh import only; no Mac execution adapter"},
82
+ "weights_bundled": False, "quantization": "FP32 student; no binary kernels or 1-bit claims"}
83
+ print(json.dumps(report, indent=2))
84
+ elif args.command == "demo-data":
85
+ from .demo import create_demo
86
+ print(create_demo(args.out, args.count, args.grid))
87
+ elif args.command == "cache":
88
+ from .data import cache_sample
89
+ from .splats import read_ply
90
+ print(json.dumps(cache_sample(args.out, args.id, args.image, read_ply(args.idol_ply), args.grid,
91
+ coarse=args.coarse_mesh, coarse_transform=args.coarse_transform,
92
+ fine=args.fine_mesh, fine_transform=args.fine_transform,
93
+ extra={"object_id": args.object_id or args.id, "idol_ply": str(Path(args.idol_ply).resolve())}), indent=2))
94
+ elif args.command == "train":
95
+ from .engine import train
96
+ train(args)
97
+ elif args.command == "generate":
98
+ from .engine import generate
99
+ print(json.dumps(generate(args.checkpoint, args.image, args.out, args.device, args.threshold, args.max_splats), indent=2))
100
+ elif args.command == "preview":
101
+ from PIL import Image, ImageDraw
102
+ import numpy as np
103
+ from .splats import preview, read_ply
104
+ splats = read_ply(args.ply)
105
+ sheet = Image.new("RGB", (1024, 280), "#111111")
106
+ draw = ImageDraw.Draw(sheet)
107
+ for i in range(4):
108
+ sheet.paste(preview(splats, yaw=i*np.pi/2), (i*256, 24))
109
+ draw.text((i*256+8, 6), f"{i*90} degrees - diagnostic view", fill="white")
110
+ out = Path(args.out)
111
+ if out.exists():
112
+ raise ValueError("Preview already exists")
113
+ out.parent.mkdir(parents=True, exist_ok=True)
114
+ sheet.save(out)
115
+ elif args.command == "teacher-idol":
116
+ from .teacher_idol import run_idol
117
+ run_idol(args)
118
+ except (ValueError, RuntimeError, FileNotFoundError, ImportError) as exc:
119
+ print(f"Error: {exc}", file=sys.stderr)
120
+ return 2
121
+ return 0
122
+
123
+
124
+ if __name__ == "__main__":
125
+ raise SystemExit(main())