mca183 commited on
Commit
281cc2c
·
verified ·
1 Parent(s): 04a8ad1

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +209 -0
README.md ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: pytorch
4
+ tags:
5
+ - 3d-reconstruction
6
+ - camera-pose-estimation
7
+ - pointmap
8
+ - multi-camera-rig
9
+ - autonomous-driving
10
+ - waymo
11
+ - dust3r
12
+ datasets:
13
+ - waymo_open_dataset
14
+ metrics:
15
+ - pointmap_err
16
+ - pose_deg
17
+ - rig_deg
18
+ model-index:
19
+ - name: rig3r-waymo
20
+ results:
21
+ - task:
22
+ type: camera-pose-estimation
23
+ name: Multi-camera rig pose estimation
24
+ dataset:
25
+ type: waymo_open_dataset
26
+ name: Waymo Open Dataset (mini subset, held-out val split)
27
+ metrics:
28
+ - type: pose_deg
29
+ value: 1.4403
30
+ name: Pose rotation error (deg)
31
+ - type: rig_deg
32
+ value: 1.4075
33
+ name: Rig rotation error (deg)
34
+ - type: pointmap_err
35
+ value: 0.2159
36
+ name: Pointmap L2 error (scale-normalized)
37
+ ---
38
+
39
+ # Open-Rig3R — Waymo (epoch 50)
40
+
41
+ Unofficial open reimplementation of **Rig3R**: a rig-aware transformer that takes multiple
42
+ camera views and predicts per-view pointmaps plus pose and rig raymaps, so a whole camera
43
+ rig is reconstructed jointly instead of one camera at a time.
44
+
45
+ Code: [engichang1467/Open-Rig3R](https://github.com/engichang1467/Open-Rig3R)
46
+
47
+ This checkpoint is epoch 50 of 50 from a single run on a Waymo mini subset. It is a
48
+ **research checkpoint from a reimplementation**, not a reproduction of the paper's
49
+ published numbers — see [Limitations](#limitations) before using it for anything.
50
+
51
+ ## Results
52
+
53
+ Held-out Waymo val split, at the end of training:
54
+
55
+ | Metric | Value |
56
+ |---|---|
57
+ | Pointmap L2 error (scale-normalized) | **0.2159** |
58
+ | Pose rotation error | **1.440°** |
59
+ | Rig rotation error | **1.408°** |
60
+ | Pose centre error | 0.0156 |
61
+ | Rig centre error | 0.0161 |
62
+
63
+ ### Read the validation curve carefully
64
+
65
+ `val/total` **rises** from 0.395 (epoch 6) to 0.961 (epoch 50). That is not overfitting,
66
+ and epoch 6 is not the better checkpoint.
67
+
68
+ The pointmap term is `C * err - alpha * log(C)`, where `C` is the model's own predicted
69
+ confidence. Over training `C` climbs from 1.2 to 9.98, saturating against the
70
+ `conf_max: 10.0` ceiling. The same geometric error therefore costs roughly 10x more at
71
+ epoch 50 than at epoch 6. Meanwhile the unweighted error stays flat or improves
72
+ (`pointmap_err` 0.279 → 0.216) and both angular errors fall monotonically
73
+ (14.10° → 1.44°, 14.16° → 1.41°).
74
+
75
+ | epoch | val/total | pointmap | **pointmap_err** | conf_mean | pose_deg | rig_deg |
76
+ |---|---|---|---|---|---|---|
77
+ | 6 | **0.395** | 0.253 | 0.2239 | 3.26 | 3.01 | 3.02 |
78
+ | 25 | 0.621 | 0.532 | 0.2187 | 6.86 | 1.63 | 1.59 |
79
+ | 50 | 0.961 | 0.880 | **0.2159** | 9.98 | **1.440** | **1.408** |
80
+
81
+ `val/total` is confounded by confidence saturation and should not be used for model
82
+ selection on this run. Select on `pointmap_err`, `pose_deg`, and `rig_deg` — all of which
83
+ plateau by roughly epoch 45 and are best at epoch 50.
84
+
85
+ ## Usage
86
+
87
+ This is a plain `state_dict`, not a `transformers` `PreTrainedModel` — there is no
88
+ `from_pretrained`. Load it into the `Rig3R` class from the repo, with the **same
89
+ architecture arguments the checkpoint was trained with** (the class defaults differ and
90
+ will not load):
91
+
92
+ ```python
93
+ from huggingface_hub import hf_hub_download
94
+ from safetensors.torch import load_file
95
+ from models.rig3r import Rig3R
96
+
97
+ model = Rig3R(
98
+ encoder_ckpt=None, # weights come from the checkpoint below, not from DUSt3R
99
+ img_size=128,
100
+ patch_size=16,
101
+ embed_dim=1024,
102
+ num_decoder_layers=2, # NOT the class default of 6
103
+ num_heads=8,
104
+ mlp_dim=4096, # NOT the class default of 2048
105
+ metadata_dropout=0.5,
106
+ )
107
+
108
+ path = hf_hub_download("mca183/rig3r-waymo", "model.safetensors")
109
+ model.load_state_dict(load_file(path))
110
+ model.eval()
111
+
112
+ # images: (B, V, 3, 128, 128) — V = n_frames * num_cameras, e.g. 2 * 5 = 10 for the full Waymo rig
113
+ # metadata is optional; the decoder is trained with per-field dropout so it runs without it
114
+ outputs = model(images, metadata=None)
115
+ ```
116
+
117
+ `forward` returns a dict:
118
+
119
+ | key | shape | notes |
120
+ |---|---|---|
121
+ | `pointmap` | `(B, V, H*W, 3)` | dense per-pixel 3D points |
122
+ | `pointmap_conf` | `(B, V, H*W, 1)` | per-pixel confidence — saturated, see [Limitations](#limitations) |
123
+ | `pose_raymap` | `(B, V, P, 6)` | centre + unit direction per patch |
124
+ | `rig_raymap` | `(B, V, P, 6)` | centre + unit direction per patch |
125
+ | `camera_center_pose` | `(B, V, 3)` | one centre per view |
126
+ | `camera_center_rig` | `(B, V, 3)` | one centre per view |
127
+ | `features` | `(B, V, P, C)` | decoder patch features, for downstream heads |
128
+
129
+ `P = (128 / 16)^2 = 64` patches per view.
130
+
131
+ ## Architecture
132
+
133
+ | | |
134
+ |---|---|
135
+ | Total parameters | 340.2 M (373 tensors, fp32) |
136
+ | Encoder | 303.2 M — DUSt3R ViT-L/16, **frozen** during training |
137
+ | Rig-aware decoder | 37.0 M — 2 pre-norm transformer layers, 8 heads, MLP dim 4096 |
138
+ | Heads | `pointmap_head`, `pose_raymap_head`, `rig_raymap_head` |
139
+ | Embedding dim | 1024 |
140
+ | Input resolution | 128 x 128, patch size 16 |
141
+
142
+ Encoder initialized from `DUSt3R_ViTLarge_BaseDecoder_512_dpt` and kept frozen, so only
143
+ the 37.0 M decoder and heads were trained.
144
+
145
+ ## Training
146
+
147
+ | | |
148
+ |---|---|
149
+ | Dataset | Waymo Open Dataset, mini subset, full 5-camera rig (FRONT, FRONT_LEFT, FRONT_RIGHT, SIDE_LEFT, SIDE_RIGHT) |
150
+ | Views per sample | 10 (`n_frames: 2` x 5 cameras) |
151
+ | Epochs | 50 |
152
+ | Batch size | 8 |
153
+ | Optimizer | AdamW, lr 1e-4, weight decay 0.01 |
154
+ | Scheduler | Cosine annealing, `eta_min` 1e-6 |
155
+ | Precision | bf16 autocast, no grad scaler |
156
+ | Loss weights | `w_point` 1.0, `w_pose` 1.0, `w_rig` 1.0 |
157
+ | Confidence regularizer | `alpha` 0.2, `beta` 1.0, `conf_max` 10.0 |
158
+ | Metadata dropout | 0.5 per field (frame index exempt) |
159
+ | Seed | 0 |
160
+ | Hardware | NVIDIA A100 80GB PCIe |
161
+ | Wall clock | ~3h 20m |
162
+
163
+ `conf_max: 10.0` is a deliberate deviation from the paper: Eq. 3 leaves `-alpha*log(C)`
164
+ unbounded below, so the ceiling floors the pointmap term at `-alpha*log(10) = -0.46`.
165
+ Setting it to `null` restores Eq. 3 exactly.
166
+
167
+ ## Limitations
168
+
169
+ - **Reimplementation, not the paper.** Unofficial; numbers here are not comparable to published Rig3R results.
170
+ - **Mini subset.** Trained on a small Waymo subset, not the full dataset. Generalization is untested.
171
+ - **128 x 128 input.** Well below the paper's resolution; pointmap detail is correspondingly coarse.
172
+ - **Shallow decoder.** 2 layers rather than 6, and the encoder is frozen throughout.
173
+ - **Waymo domain only.** Driving scenes, one rig geometry. No indoor, handheld, or non-automotive evaluation.
174
+ - **Single run, no held-out test.** Metrics are val-split only, one seed, no ablations.
175
+ - **Confidence is saturated.** `conf_mean` sits at the `conf_max` ceiling of 10.0, so predicted confidence is not calibrated and should not be read as an uncertainty estimate.
176
+
177
+ ## Dataset terms
178
+
179
+ Trained on the Waymo Open Dataset, which carries its own license and terms of use. Using
180
+ this model does not grant any rights to that data — obtain it from Waymo directly and
181
+ comply with their terms.
182
+
183
+ ## License
184
+
185
+ MIT (see the [source repo](https://github.com/engichang1467/Open-Rig3R)). Copyright 2025
186
+ Michael Chang. The DUSt3R encoder initialization and the Waymo Open Dataset carry their
187
+ own separate licenses.
188
+
189
+ ## Citation
190
+
191
+ Rig3R (original paper):
192
+
193
+ ```bibtex
194
+ @article{rig3r,
195
+ title = {Rig3R: Rig-Aware Conditioning for Learned 3D Reconstruction},
196
+ year = {2025}
197
+ }
198
+ ```
199
+
200
+ This reimplementation:
201
+
202
+ ```bibtex
203
+ @software{open_rig3r,
204
+ author = {Chang, Michael},
205
+ title = {Open-Rig3R: An open reimplementation of Rig3R},
206
+ url = {https://github.com/engichang1467/Open-Rig3R},
207
+ year = {2025}
208
+ }
209
+ ```