Commit d939c9f
LangSplatV2: Integrate TensorBoard logging with evaluation images (#55)
## Summary
Integrates TensorBoard logging with evaluation images into the
LangSplatV2 training pipeline, following the GARfVDB writer pattern
(`GaussianSplatSegmentationWriter`) and using language-feature-specific
visualizations (PCA projections, error heatmaps, feature coverage).
- **Create `LangSplatV2Writer` + `LangSplatV2WriterConfig`** in
`langsplatv2/training/langsplatv2_writer.py` — duplicates the GARfVDB
writer interface (CSV metrics, disk image saving, checkpoints,
TensorBoard) without cross-project dependency
- **Add `cosine_error_map()` visualization utility** to
`langsplatv2/util.py` — computes per-pixel `1 - cosine_similarity` and
maps through the turbo colormap
- **Refactor `LangSplatV2Trainer` to use the writer** — replaces
internal `_log_metric()` / `_save_checkpoint()` / file management with
an injected `LangSplatV2Writer` instance
- **Add periodic training image logging** — PCA of predicted/GT
features, feature coverage mask, cosine error heatmap (controlled by new
`log_test_images` config flag)
- **Enhance `eval()` with full image diagnostics** — beauty render,
predicted features PCA, GT features PCA, cosine error heatmap, alpha
map, and side-by-side comparison composite
- **Update `train_langsplatv2.py`** — accepts `io:
LangSplatV2WriterConfig` parameter and instantiates the writer before
training
Fixes #54
---------
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent 545b213 commit d939c9f
12 files changed
Lines changed: 1066 additions & 199 deletions
File tree
- instance_segmentation/garfvdb/garfvdb
- open_vocabulary_segmentation/langsplatv2
- langsplatv2
- scene_transforms
- training
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | | - | |
| 11 | + | |
10 | 12 | | |
11 | | - | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| 18 | + | |
| 19 | + | |
15 | 20 | | |
16 | | - | |
| 21 | + | |
17 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
18 | 32 | | |
19 | | - | |
20 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
21 | 47 | | |
22 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
23 | 83 | | |
24 | | - | |
| 84 | + | |
25 | 85 | | |
26 | | - | |
| 86 | + | |
27 | 87 | | |
28 | | - | |
| 88 | + | |
29 | 89 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
35 | 93 | | |
36 | | - | |
| 94 | + | |
37 | 95 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 96 | + | |
43 | 97 | | |
44 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
45 | 101 | | |
46 | | - | |
| 102 | + | |
47 | 103 | | |
48 | | - | |
49 | | - | |
50 | | - | |
| 104 | + | |
51 | 105 | | |
52 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
53 | 109 | | |
54 | 110 | | |
55 | 111 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
Lines changed: 33 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
39 | 56 | | |
40 | 57 | | |
41 | 58 | | |
| |||
172 | 189 | | |
173 | 190 | | |
174 | 191 | | |
| 192 | + | |
175 | 193 | | |
176 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
177 | 199 | | |
178 | 200 | | |
179 | 201 | | |
| |||
213 | 235 | | |
214 | 236 | | |
215 | 237 | | |
| 238 | + | |
216 | 239 | | |
217 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
218 | 245 | | |
219 | 246 | | |
220 | 247 | | |
| |||
294 | 321 | | |
295 | 322 | | |
296 | 323 | | |
297 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
298 | 330 | | |
299 | 331 | | |
300 | 332 | | |
| |||
Lines changed: 22 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 66 | | |
70 | 67 | | |
71 | 68 | | |
72 | 69 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | 70 | | |
82 | 71 | | |
83 | 72 | | |
84 | | - | |
| 73 | + | |
85 | 74 | | |
86 | 75 | | |
87 | 76 | | |
| |||
90 | 79 | | |
91 | 80 | | |
92 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
93 | 98 | | |
94 | | - | |
| 99 | + | |
| 100 | + | |
95 | 101 | | |
| 102 | + | |
| 103 | + | |
96 | 104 | | |
97 | 105 | | |
98 | 106 | | |
99 | | - | |
| 107 | + | |
100 | 108 | | |
101 | 109 | | |
102 | 110 | | |
| |||
0 commit comments