Add Kosmo-GFM model card and overview
Browse files- .gitattributes +1 -0
- README.md +225 -0
- assets/kosmo-gfm-overview.png +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* 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
|
|
|
|
|
|
| 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
|
| 36 |
+
assets/kosmo-gfm-overview.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,3 +1,228 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
license: apache-2.0
|
| 5 |
+
library_name: pytorch
|
| 6 |
+
pipeline_tag: depth-estimation
|
| 7 |
+
tags:
|
| 8 |
+
- computer-vision
|
| 9 |
+
- multi-view-reconstruction
|
| 10 |
+
- camera-pose-estimation
|
| 11 |
+
- point-tracking
|
| 12 |
+
- scene-flow
|
| 13 |
+
- image-matching
|
| 14 |
---
|
| 15 |
+
|
| 16 |
+
# Kosmo-GFM: A Production-Ready Geometry Foundation Model
|
| 17 |
+
|
| 18 |
+
**Kosmo Research**
|
| 19 |
+
|
| 20 |
+
[Project](https://kosmoresearch.github.io/Kosmo-GFM/) Β· [Code](https://github.com/KosmoResearch/Kosmo-GFM) Β· [Checkpoints](https://huggingface.co/KosmoResearch/Kosmo-GFM/tree/main)
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
|
| 24 |
+
## Overview
|
| 25 |
+
|
| 26 |
+
Kosmo-GFM predicts camera parameters, depth, cross-view correspondences, and
|
| 27 |
+
dynamic 3D points from images and videos. A shared multi-view encoder supports
|
| 28 |
+
task-specific geometry, motion, and matching decoders, with optional camera
|
| 29 |
+
conditioning for reconstruction from known poses.
|
| 30 |
+
|
| 31 |
+
The code repository provides standalone inference for **GFM**, **Camera Condition GFM**,
|
| 32 |
+
**GFM 4D**, and **MVLoMA**. The full PoseEngine and Gaussian Splatting pipelines
|
| 33 |
+
described in the technical report are not included.
|
| 34 |
+
|
| 35 |
+
## Model Cards
|
| 36 |
+
|
| 37 |
+
All geometry models use a ViT-g backbone. Parameter counts are rounded for the
|
| 38 |
+
provided checkpoints. β
indicates a supported capability; β indicates it is
|
| 39 |
+
not part of that inference configuration.
|
| 40 |
+
|
| 41 |
+
| Model | Params | Depth | Camera Est. | Camera Cond. | 4D Motion | Matching |
|
| 42 |
+
| --- | --- | --- | --- | --- | --- | --- |
|
| 43 |
+
| [GFM](#gfm) | 1.66B | β
| β
| β | β | β |
|
| 44 |
+
| [Camera Condition GFM](#camera-condition-gfm) | 1.77B | β
| β
| β
| β | β |
|
| 45 |
+
| [GFM 4D](#gfm-4d) | 1.65B | β
| β
| β | β
| β |
|
| 46 |
+
| [GFM + MVLoMA](#gfm-with-mvloma) | 1.73B | β
| β
| β | β | β
|
|
| 47 |
+
|
| 48 |
+
- **Camera Condition GFM** is the **Camera-pose scale** version and takes
|
| 49 |
+
camera extrinsics and intrinsics as input.
|
| 50 |
+
- **GFM + MVLoMA** shares the GFM encoder and adds a 75.9M-parameter matching
|
| 51 |
+
head. It requires both the GFM and MVLoMA checkpoints.
|
| 52 |
+
- **GFM 4D** predicts geometry and cross-frame motion for Dynamic Points and
|
| 53 |
+
Scene Flow evaluation.
|
| 54 |
+
|
| 55 |
+
| Checkpoint | Inference configuration |
|
| 56 |
+
| --- | --- |
|
| 57 |
+
| [`gfm_3d.pth`](https://huggingface.co/KosmoResearch/Kosmo-GFM/blob/main/gfm_3d.pth) | GFM: depth, cameras, and point clouds |
|
| 58 |
+
| [`gfm_3d_camera_cond.pth`](https://huggingface.co/KosmoResearch/Kosmo-GFM/blob/main/gfm_3d_camera_cond.pth) | Camera Condition GFM: Camera-pose scale version |
|
| 59 |
+
| [`gfm_4d.pth`](https://huggingface.co/KosmoResearch/Kosmo-GFM/blob/main/gfm_4d.pth) | GFM 4D: geometry and cross-frame motion |
|
| 60 |
+
| [`mvloma.pth`](https://huggingface.co/KosmoResearch/Kosmo-GFM/blob/main/mvloma.pth) | MVLoMA matching head; requires `gfm_3d.pth` |
|
| 61 |
+
|
| 62 |
+
## Quick Start
|
| 63 |
+
|
| 64 |
+
Download the code and checkpoints, then run inference from the code repository root.
|
| 65 |
+
|
| 66 |
+
### Installation
|
| 67 |
+
|
| 68 |
+
Requires Python 3.10+ and a CUDA GPU. Install a compatible PyTorch / torchvision
|
| 69 |
+
build, then:
|
| 70 |
+
|
| 71 |
+
```bash
|
| 72 |
+
git clone https://github.com/KosmoResearch/Kosmo-GFM.git
|
| 73 |
+
cd Kosmo-GFM
|
| 74 |
+
pip install -e .
|
| 75 |
+
pip install -U huggingface_hub
|
| 76 |
+
# Optional PLY/GLB export
|
| 77 |
+
pip install -r requirements-optional.txt
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
### Download Checkpoints
|
| 81 |
+
|
| 82 |
+
Download all four checkpoints into the `weights/` directory:
|
| 83 |
+
|
| 84 |
+
```python
|
| 85 |
+
from huggingface_hub import snapshot_download
|
| 86 |
+
|
| 87 |
+
snapshot_download(
|
| 88 |
+
repo_id="KosmoResearch/Kosmo-GFM",
|
| 89 |
+
local_dir="weights",
|
| 90 |
+
allow_patterns=[
|
| 91 |
+
"gfm_3d.pth",
|
| 92 |
+
"gfm_3d_camera_cond.pth",
|
| 93 |
+
"gfm_4d.pth",
|
| 94 |
+
"mvloma.pth",
|
| 95 |
+
],
|
| 96 |
+
)
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
To download only the checkpoints you need, reduce `allow_patterns` accordingly.
|
| 100 |
+
See the [Hugging Face download guide](https://huggingface.co/docs/huggingface_hub/en/guides/download)
|
| 101 |
+
for authentication and download options.
|
| 102 |
+
|
| 103 |
+
These are PyTorch checkpoints loaded by the GFM inference scripts.
|
| 104 |
+
|
| 105 |
+
### Inference
|
| 106 |
+
|
| 107 |
+
Run from the repository root with your own images or video frames.
|
| 108 |
+
|
| 109 |
+
#### GFM
|
| 110 |
+
|
| 111 |
+
```bash
|
| 112 |
+
python tools/infer_3d.py \
|
| 113 |
+
--checkpoint weights/gfm_3d.pth --input /path/to/images \
|
| 114 |
+
--output outputs/gfm --save-npz --no-ply --no-glb
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
+
Exports depth, confidence, cameras and point clouds to `predictions.npz`.
|
| 118 |
+
The default backbone is `vitg`; use `--model-size` to match your checkpoint.
|
| 119 |
+
|
| 120 |
+
#### Camera Condition GFM
|
| 121 |
+
|
| 122 |
+
The provided checkpoint is the **Camera-pose scale** version.
|
| 123 |
+
|
| 124 |
+
```bash
|
| 125 |
+
python tools/infer_3d_camera_cond.py \
|
| 126 |
+
--checkpoint weights/gfm_3d_camera_cond.pth --input /path/to/images \
|
| 127 |
+
--camera-npz /path/to/cameras.npz --output outputs/gfm_camera \
|
| 128 |
+
--save-npz --no-ply --no-glb
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
+
The camera NPZ requires `extrinsics` (`[N,4,4]` or `[N,3,4]`, OpenCV
|
| 132 |
+
world-to-camera) and `intrinsics` (`[N,3,3]`, at original image resolution).
|
| 133 |
+
Cameras follow filename-sorted image order unless `image_names` is supplied.
|
| 134 |
+
Use `--camera-convention c2w` for camera-to-world matrices.
|
| 135 |
+
|
| 136 |
+
#### GFM 4D
|
| 137 |
+
|
| 138 |
+
```bash
|
| 139 |
+
python tools/infer_4d.py \
|
| 140 |
+
--checkpoint weights/gfm_4d.pth --input /path/to/frames \
|
| 141 |
+
--output outputs/gfm_4d --save-npz --no-ply --no-glb
|
| 142 |
+
```
|
| 143 |
+
|
| 144 |
+
Exports geometry, cameras and motion to `predictions.npz` at relative scene scale.
|
| 145 |
+
Use `--chunk-size` to control query decoding memory.
|
| 146 |
+
|
| 147 |
+
#### GFM with MVLoMA
|
| 148 |
+
|
| 149 |
+
```bash
|
| 150 |
+
python tools/infer_3d_with_mvloma.py \
|
| 151 |
+
--checkpoint weights/gfm_3d.pth --mvloma-checkpoint weights/mvloma.pth \
|
| 152 |
+
--input /path/to/images --output outputs/gfm_with_mvloma --no-ply --no-glb
|
| 153 |
+
```
|
| 154 |
+
|
| 155 |
+
Exports geometry to `predictions.npz` and image matches to `matches.npz`.
|
| 156 |
+
Requires at least two images. Use `--all-pairs` to export every image pair.
|
| 157 |
+
|
| 158 |
+
For PLY/GLB output, install the optional dependencies and omit
|
| 159 |
+
`--no-ply --no-glb`. Each script provides additional options through `--help`.
|
| 160 |
+
|
| 161 |
+
## Benchmarks
|
| 162 |
+
|
| 163 |
+
### SpatialBench
|
| 164 |
+
|
| 165 |
+
GFM results on SpatialBench.
|
| 166 |
+
Higher is better for β; lower is better for β. Accuracy and AUC values are
|
| 167 |
+
reported on a 0β1 scale.
|
| 168 |
+
|
| 169 |
+
**Depth**
|
| 170 |
+
|
| 171 |
+
| Setting | AbsRelβ | SqRelβ | RMSEβ | Ξ΄1.03β | Ξ΄1.05β | Ξ΄1.10β |
|
| 172 |
+
| --- | --- | --- | --- | --- | --- | --- |
|
| 173 |
+
| Sparse | 0.0630 | 0.1093 | 0.6207 | 0.6696 | 0.7810 | 0.8816 |
|
| 174 |
+
| Medium | 0.0594 | 0.0884 | 0.5822 | 0.6895 | 0.8077 | 0.9025 |
|
| 175 |
+
|
| 176 |
+
**Camera**
|
| 177 |
+
|
| 178 |
+
| Setting | RAcc3β | RAcc5β | TAcc3β | TAcc5β | AUC@5β | AUC@15β | AUC@30β |
|
| 179 |
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
| 180 |
+
| Sparse | 0.8358 | 0.9055 | 0.6457 | 0.7394 | 0.5726 | 0.7412 | 0.8226 |
|
| 181 |
+
| Medium | 0.8310 | 0.8938 | 0.6468 | 0.7322 | 0.5820 | 0.7450 | 0.8281 |
|
| 182 |
+
|
| 183 |
+
See [SpatialBench](https://github.com/KosmoResearch/Kosmo-GFM/blob/main/bench/SpatialBench/README.md) for evaluation usage.
|
| 184 |
+
|
| 185 |
+
### GFM4DBench
|
| 186 |
+
|
| 187 |
+
GFM results on GFM4DBench.
|
| 188 |
+
|
| 189 |
+
| Dataset | Point APD (%)β | Point EPE (m)β | Flow Accuracy (%)β | Flow EPE (m)β |
|
| 190 |
+
| --- | --- | --- | --- | --- |
|
| 191 |
+
| Panoptic Studio | 83.41 | 0.1411 | 50.15 | 0.1257 |
|
| 192 |
+
| PointOdyssey | 85.73 | 0.1474 | 83.02 | 0.0521 |
|
| 193 |
+
| Dynamic Replica | 80.76 | 0.2017 | 91.31 | 0.0279 |
|
| 194 |
+
| Aria Digital Twin | 89.78 | 0.1102 | 96.34 | 0.0134 |
|
| 195 |
+
| SynthVerse | 42.49 | 1.1105 | 34.56 | 0.7213 |
|
| 196 |
+
| Mean | 76.43 | 0.3422 | 71.08 | 0.1881 |
|
| 197 |
+
|
| 198 |
+
Mean is the arithmetic average across all five datasets.
|
| 199 |
+
|
| 200 |
+
See [GFM4DBench](https://github.com/KosmoResearch/Kosmo-GFM/blob/main/bench/GFM4DBench/README.md) for Dynamic Points and Scene Flow
|
| 201 |
+
evaluation on TapVid3D / WorldTrack and SynthVerse.
|
| 202 |
+
|
| 203 |
+
## Acknowledgements
|
| 204 |
+
|
| 205 |
+
Thanks to [VGGT](https://github.com/facebookresearch/vggt),
|
| 206 |
+
[DINOv2](https://github.com/facebookresearch/dinov2),
|
| 207 |
+
[Depth Anything 3](https://github.com/ByteDance-Seed/Depth-Anything-3),
|
| 208 |
+
[DPT](https://github.com/isl-org/DPT), [DeDoDe](https://github.com/Parskatt/DeDoDe),
|
| 209 |
+
[DaD](https://github.com/Parskatt/DaD), [LightGlue](https://github.com/cvg/LightGlue),
|
| 210 |
+
[SpatialBench](https://github.com/Ropedia/SpatialBench), and
|
| 211 |
+
[Open-d4rt](https://github.com/Lijiaxin0111/Open-d4rt).
|
| 212 |
+
|
| 213 |
+
## Citation
|
| 214 |
+
|
| 215 |
+
```bibtex
|
| 216 |
+
@techreport{kosmo2026gfm,
|
| 217 |
+
title={{Kosmo-GFM}: A Production-Ready Geometry Foundation Model},
|
| 218 |
+
author={{Kosmo Research}},
|
| 219 |
+
institution={Kosmo Research},
|
| 220 |
+
year={2026}
|
| 221 |
+
}
|
| 222 |
+
```
|
| 223 |
+
|
| 224 |
+
## License
|
| 225 |
+
|
| 226 |
+
Original code is licensed under [Apache-2.0](https://github.com/KosmoResearch/Kosmo-GFM/blob/main/LICENSE). Third-party terms,
|
| 227 |
+
including the [VGGT use restrictions](https://github.com/KosmoResearch/Kosmo-GFM/blob/main/licenses/VGGT-LICENSE.txt), also apply;
|
| 228 |
+
see [NOTICE](https://github.com/KosmoResearch/Kosmo-GFM/blob/main/NOTICE) and [provenance notes](https://github.com/KosmoResearch/Kosmo-GFM/blob/main/licenses/README.md).
|
assets/kosmo-gfm-overview.png
ADDED
|
Git LFS Details
|