dotblue commited on
Commit
5bd7ff9
·
0 Parent(s):

feat(models): publish the GenSfM inference bundle

Browse files
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ .cache/
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 GenSfM authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
LICENSE_TRELLIS ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE
README.md ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: mit
4
+ pipeline_tag: image-to-3d
5
+ base_model: microsoft/TRELLIS-image-large
6
+ tags:
7
+ - multi-view
8
+ - 3d-reconstruction
9
+ - camera-pose-estimation
10
+ - safetensors
11
+ ---
12
+
13
+ # GenSfM pretrained models
14
+
15
+ GenSfM jointly reconstructs an object and its cameras from two to four foreground-masked views. Four views are recommended. This repository contains the complete reconstruction weights for the native two-stage pipeline.
16
+
17
+ ## Usage
18
+
19
+ Install the GenSfM code and its inference dependencies first. From the code repository, run the multi-view entrypoint:
20
+
21
+ ```bash
22
+ python example_multi_image.py \
23
+ --pretrained dotblue/GenSfm \
24
+ --input-dir /path/to/object-views \
25
+ --output-dir outputs/my-object
26
+ ```
27
+
28
+ The same argument also accepts a local model directory. Use `--revision` to select a specific Hub tag or commit.
29
+
30
+ ```python
31
+ from trellis.pipelines import GenSfMPipeline
32
+
33
+ pipeline = GenSfMPipeline.from_pretrained("dotblue/GenSfm").cuda()
34
+ result = pipeline.run(["00.png", "01.png", "02.png", "03.png"], seed=1)
35
+ mesh = result["mesh"][0]
36
+ gaussians = result["gaussian"][0]
37
+ extrinsics, intrinsics = result["extrinsics"], result["intrinsics"]
38
+ ```
39
+
40
+ Inputs are ordered paths to RGBA images of the same rigid object. For photographs without alpha, add `--remove-background` to the CLI or pass `remove_background=True` to `run`. Camera intrinsics are normalized complete matrices, and extrinsics use OpenCV world-to-camera coordinates in the model's Z-up frame. The CLI exports a textured GLB, Gaussians, camera matrices, inputs and reprojections.
41
+
42
+ DINOv2 (`dinov2_vitl14_reg`) is obtained separately through Torch Hub. Optional background removal uses rembg's own model. Both need a first-use download or an existing cache.
43
+
44
+ ## Contents
45
+
46
+ `pipeline.json` maps six runtime roles to model prefixes and records both samplers, latent normalization and input preprocessing. Each prefix has a `.json` architecture file and a `.safetensors` state dictionary.
47
+
48
+ | Prefix under `ckpts/` | Purpose |
49
+ | --- | --- |
50
+ | `stage1_joint` | Native joint shape and per-view camera flow model |
51
+ | `stage2_slat` | Trained ConvNeXt geometry and appearance flow model |
52
+ | `uv_decoder` | Trained UV representation decoder |
53
+ | `ss_decoder` | TRELLIS occupancy decoder |
54
+ | `slat_decoder_gs` | TRELLIS Gaussian decoder |
55
+ | `slat_decoder_mesh` | TRELLIS mesh decoder |
56
+ | `slat_encoder` | TRELLIS conditioning encoder loaded internally by stage 2 |
57
+
58
+ No training directories or machine-specific paths are needed. The bundle includes inference weights; full training resume state is not included.
59
+
60
+ ## License and acknowledgements
61
+
62
+ The model weights are released under the [MIT License](LICENSE).
63
+
64
+ The sparse-structure decoder, SLat Gaussian/mesh decoders and SLat encoder originate from [microsoft/TRELLIS-image-large](https://huggingface.co/microsoft/TRELLIS-image-large). Their original MIT notice is preserved in `LICENSE_TRELLIS`. DINOv2 and optional background-removal weights are external dependencies and are not redistributed here.
ckpts/slat_decoder_gs.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "SLatGaussianDecoder",
3
+ "args": {
4
+ "resolution": 64,
5
+ "model_channels": 768,
6
+ "latent_channels": 8,
7
+ "num_blocks": 12,
8
+ "num_heads": 12,
9
+ "mlp_ratio": 4,
10
+ "attn_mode": "swin",
11
+ "window_size": 8,
12
+ "use_fp16": true,
13
+ "representation_config": {
14
+ "lr": {
15
+ "_xyz": 1.0,
16
+ "_features_dc": 1.0,
17
+ "_opacity": 1.0,
18
+ "_scaling": 1.0,
19
+ "_rotation": 0.1
20
+ },
21
+ "perturb_offset": true,
22
+ "voxel_size": 1.5,
23
+ "num_gaussians": 32,
24
+ "2d_filter_kernel_size": 0.1,
25
+ "3d_filter_kernel_size": 0.0009,
26
+ "scaling_bias": 0.004,
27
+ "opacity_bias": 0.1,
28
+ "scaling_activation": "softplus"
29
+ }
30
+ }
31
+ }
ckpts/slat_decoder_gs.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38c84bcef5ce0af1f48b1b5558dabc7575a13346043c41a7e0610f1fa619a161
3
+ size 171450952
ckpts/slat_decoder_mesh.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "SLatMeshDecoder",
3
+ "args": {
4
+ "resolution": 64,
5
+ "model_channels": 768,
6
+ "latent_channels": 8,
7
+ "num_blocks": 12,
8
+ "num_heads": 12,
9
+ "mlp_ratio": 4,
10
+ "attn_mode": "swin",
11
+ "window_size": 8,
12
+ "use_fp16": true,
13
+ "representation_config": {
14
+ "use_color": true
15
+ }
16
+ }
17
+ }
ckpts/slat_decoder_mesh.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e87aba94b5786407eb06d0502c1ed0885a0027a3f2b8537bfe15b0a92c01859
3
+ size 181903412
ckpts/slat_encoder.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "SLatEncoder",
3
+ "args": {
4
+ "resolution": 64,
5
+ "in_channels": 1024,
6
+ "model_channels": 768,
7
+ "latent_channels": 8,
8
+ "num_blocks": 12,
9
+ "num_heads": 12,
10
+ "mlp_ratio": 4,
11
+ "attn_mode": "swin",
12
+ "window_size": 8,
13
+ "use_fp16": true
14
+ }
15
+ }
ckpts/slat_encoder.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21dceac6bee917ab6458ff52c9757ba89a779d03031c7bd17f9e7f0103bfd436
3
+ size 173242816
ckpts/ss_decoder.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "SparseStructureDecoder",
3
+ "args": {
4
+ "out_channels": 1,
5
+ "latent_channels": 8,
6
+ "num_res_blocks": 2,
7
+ "num_res_blocks_middle": 2,
8
+ "channels": [
9
+ 512,
10
+ 128,
11
+ 32
12
+ ],
13
+ "use_fp16": true
14
+ }
15
+ }
ckpts/ss_decoder.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c76d4a40519aa2d711cc263a8404105231ac26db31d946bed48b84fee79009a
3
+ size 147591972
ckpts/stage1_joint.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "VisualMultiPoseSparseStructureFlowModel",
3
+ "args": {
4
+ "resolution": 16,
5
+ "in_channels": 8,
6
+ "out_channels": 8,
7
+ "pose_resolution": 4,
8
+ "pose_in_channels": 8,
9
+ "pose_out_channels": 8,
10
+ "model_channels": 1024,
11
+ "cond_channels": 1536,
12
+ "dino_cond_channels": 1024,
13
+ "visual_input_channels": 3,
14
+ "visual_feat_resolution": 296,
15
+ "visual_patch_resolution": 37,
16
+ "visual_feat_channels": [
17
+ 6,
18
+ 6,
19
+ 6,
20
+ 8
21
+ ],
22
+ "visual_conv_kernel_size": 5,
23
+ "num_blocks": 24,
24
+ "num_heads": 16,
25
+ "mlp_ratio": 4,
26
+ "patch_size": 1,
27
+ "pose_patch_size": 1,
28
+ "pe_mode": "ape",
29
+ "fusion_layer_type": null,
30
+ "self_attn_layout": "joint",
31
+ "cross_attn_layout": "full",
32
+ "num_view_embeds": 4,
33
+ "num_shared_register_tokens": 128,
34
+ "qk_rms_norm": true,
35
+ "use_fp16": true
36
+ }
37
+ }
ckpts/stage1_joint.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a31f03d184af60c14db71e3799397744bb53ae3d4b520c229b8d45bed83ec1c9
3
+ size 2340577920
ckpts/stage2_slat.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "ConvNeXtVisualLatentConditioningSLatFlowModel",
3
+ "args": {
4
+ "resolution": 64,
5
+ "in_channels": 8,
6
+ "out_channels": 8,
7
+ "model_channels": 1024,
8
+ "cond_channels": 1024,
9
+ "cond_latent_channels": 8,
10
+ "visual_feat_channels": [
11
+ 4,
12
+ 4,
13
+ 4,
14
+ 4
15
+ ],
16
+ "visual_feat_resolution": 256,
17
+ "hidden_channels": 32,
18
+ "num_pyramid_blocks": 1,
19
+ "pyramid_mlp_ratio": 4.0,
20
+ "dwconv_kernel_size": 7,
21
+ "stem_kernel_size": 3,
22
+ "stem_stride": 1,
23
+ "layer_scale_init": 1e-06,
24
+ "mask_injection": "stem",
25
+ "num_blocks": 24,
26
+ "num_heads": 16,
27
+ "mlp_ratio": 4,
28
+ "patch_size": 2,
29
+ "num_io_res_blocks": 2,
30
+ "io_block_channels": [
31
+ 128
32
+ ],
33
+ "pe_mode": "ape",
34
+ "qk_rms_norm": true,
35
+ "use_fp16": true,
36
+ "pretrained_slat_enc": "./slat_encoder"
37
+ }
38
+ }
ckpts/stage2_slat.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4f4bd0ec513eb9727dd7240eff34c68c8749d7e9d97a7640e0703fa2e391c024
3
+ size 2402022552
ckpts/uv_decoder.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "SparseStructureDecoder",
3
+ "args": {
4
+ "out_channels": 3,
5
+ "latent_channels": 8,
6
+ "num_res_blocks": 2,
7
+ "num_res_blocks_middle": 2,
8
+ "channels": [
9
+ 512,
10
+ 256,
11
+ 128,
12
+ 64,
13
+ 32
14
+ ],
15
+ "use_fp16": true
16
+ }
17
+ }
ckpts/uv_decoder.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc93c8fb1b4a3d52c92784bc5733fe905ec886515c5c74651546e8a0f9a14db8
3
+ size 415051644
pipeline.json ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "GenSfMPipeline",
3
+ "args": {
4
+ "models": {
5
+ "denoiser": "ckpts/stage1_joint",
6
+ "slat_denoiser": "ckpts/stage2_slat",
7
+ "ss_decoder": "ckpts/ss_decoder",
8
+ "suv_decoder": "ckpts/uv_decoder",
9
+ "slat_decoder_gs": "ckpts/slat_decoder_gs",
10
+ "slat_decoder_mesh": "ckpts/slat_decoder_mesh"
11
+ },
12
+ "inference": {
13
+ "normalization": {
14
+ "mean": [
15
+ -2.1687545776367188,
16
+ -0.004347046371549368,
17
+ -0.13352349400520325,
18
+ -0.08418072760105133,
19
+ -0.5271206498146057,
20
+ 0.7238689064979553,
21
+ -1.1414450407028198,
22
+ 1.2039363384246826
23
+ ],
24
+ "std": [
25
+ 2.377650737762451,
26
+ 2.386378288269043,
27
+ 2.124418020248413,
28
+ 2.1748552322387695,
29
+ 2.663944721221924,
30
+ 2.371192216873169,
31
+ 2.6217446327209473,
32
+ 2.684523105621338
33
+ ]
34
+ },
35
+ "ssuv_sampler_args": {
36
+ "name": "MultiPoseFlowEulerGuidanceIntervalSampler",
37
+ "args": {
38
+ "sigma_min": 1e-05
39
+ },
40
+ "params": {
41
+ "steps": 25,
42
+ "cfg_strength": 7.5,
43
+ "cfg_interval": [
44
+ 0.5,
45
+ 1.0
46
+ ],
47
+ "rescale_t": 3.0
48
+ }
49
+ },
50
+ "slat_sampler_args": {
51
+ "name": "FlowEulerGuidanceIntervalSampler",
52
+ "args": {
53
+ "sigma_min": 1e-05
54
+ },
55
+ "params": {
56
+ "steps": 25,
57
+ "cfg_strength": 3.0,
58
+ "cfg_interval": [
59
+ 0.5,
60
+ 1.0
61
+ ],
62
+ "rescale_t": 3.0
63
+ }
64
+ },
65
+ "image_cond_model": "dinov2_vitl14_reg",
66
+ "ssuv_uses_visual": true,
67
+ "predict_ssuv_from_ss": true,
68
+ "dilation_sigma": 0.5,
69
+ "dilation_min_weight": 0.05,
70
+ "render_resolution": 518,
71
+ "render_bg_color": [
72
+ 0.0,
73
+ 0.0,
74
+ 0.0
75
+ ],
76
+ "ssuv_expand_min_num_activated": 10,
77
+ "ssuv_expand_threshold_step": 0.05
78
+ },
79
+ "preprocessing": {
80
+ "image_size": 518,
81
+ "crop_size_ratio": 1.2,
82
+ "max_views": 4
83
+ }
84
+ }
85
+ }