Docs

Structure from motion

fastforks sfm turns an image folder into camera poses and a sparse point cloud, the way hloc or COLMAP's feature pipeline do: image retrieval picks the image pairs, a matcher finds corresponding points, a GPU RANSAC verifies them, and the COLMAP mapper (pycolmap) builds the reconstruction.

fastforks sfm scene/images scene/database.db              # COLMAP database: MegaLoc pairs (k=20), LoMa-B matches
colmap mapper --database_path scene/database.db --image_path scene/images --output_path scene/sparse
fastforks sfm scene/images scene/out --reconstruct        # both steps: out/database.db + out/sparse/0
fastforks sfm scene/images scene/out --reconstruct --matcher aliked-lightglue   # the fast matcher (below)
from fastforks.matching import sfm

stats = sfm.colmap_database("scene/images", "scene/database.db", k=30)  # the default matcher, loma-b
print(stats.verified, stats.seconds)  # per stage: retrieval, matching (incl. verification), database
rec = sfm.reconstruct("scene/images", "scene/out", k=30)  # + pycolmap's mapper; rec.model = scene/out/sparse/0
print(rec.registered, rec.points, rec.seconds)

reconstruct and --reconstruct need pycolmap (pip install 'fastforks-core[sfm]'); --mapper global uses GLOMAP's global mapper (pycolmap >= 3.12) instead of the incremental one. --retrieval none matches all pairs, --k sets the pairs per image, --single-camera shares one set of intrinsics among images of the same size, --threshold is the RANSAC inlier threshold (4 px, as COLMAP). The database uses the COLMAP 3 schema; COLMAP 4 and pycolmap 4 read it. Dense matchers (romav2, romav1, loftr) also work (dense_matches most certain pixels per pair, like hloc's match_dense) but take 10x longer and are not in the tables below.

Which matcher

Nine scenes, each run from the image folder to the reconstruction on an RTX 5060 Ti with the pycolmap incremental mapper (16 CPU threads). AUC@3 is the share of camera pairs whose relative pose is within 3 degrees of the reference (100 = perfect), total time = matching front end + mapper incl. model loading, peak memory = GPU memory reserved by the front end. Where a scene was run more than once the range is given in parentheses; differences inside such a range are ties.

Mip-NeRF 360 (125-311 photos of one object or room, 1/4 resolution)

Reference poses: the scenes' COLMAP reconstructions.

scenefront endAUC@3registered imagestotal timepeak memorycommercial use
gardenaliked-lightglue95.1185/185126 s1370 MByes
gardendisk-lightglue97.6185/185121 s2506 MByes
gardenloma-b (default)97.7185/185197 s3320 MByes
gardenaliked-flexglue95.2185/185279 s2418 MByes, DINOv3 licence terms
counteraliked-lightglue95.6240/240223 s1426 MByes
counterdisk-lightglue96.1240/240250 s2438 MByes
counterloma-b (default)98.2240/240286 s2376 MByes
counteraliked-flexglue95.7240/240398 s2100 MByes, DINOv3 licence terms
stumpaliked-lightglue93.7125/12567 s1384 MByes
stumpdisk-lightglue96.1125/12567 s2530 MByes
stumploma-b (default)97.1125/125108 s2376 MByes
stumpaliked-flexglue94.5125/125181 s2140 MByes, DINOv3 licence terms
bicyclealiked-lightglue93.1194/194135 s1422 MByes
bicycledisk-lightglue92.8194/194143 s2568 MByes
bicycleloma-b (default)94.4194/194197 s2392 MByes
bicyclealiked-flexglue92.8194/194284 s2492 MByes, DINOv3 licence terms
kitchenaliked-lightglue91.4279/279287 s1432 MByes
kitchendisk-lightglue87.3279/279290 s2446 MByes
kitchenloma-b (default)92.8279/279380 s2376 MByes
kitchenaliked-flexglue92.0279/279482 s2124 MByes, DINOv3 licence terms
roomaliked-lightglue92.9311/311214 s1530 MByes
roomdisk-lightglue94.1311/311282 s2580 MByes
roomloma-b (default)95.4311/311365 s2680 MByes
roomaliked-flexglue93.6311/311494 s2454 MByes, DINOv3 licence terms

ETH3D high-res (38-76 DSLR photos, 6048 x 4032, laser-scan reference poses)

scenefront endAUC@3registered imagestotal timepeak memorycommercial use
facadealiked-lightglue62.676/76121 s2324 MByes
facadedisk-lightglue44.276/76132 s2974 MByes
facadeloma-b (default)59.0 (58.8-59.3)76/76233 s3418 MByes
facadealiked-flexglue71.076/76261 s3100 MByes, DINOv3 licence terms
courtyardaliked-lightglue25.438/3858 s2286 MByes
courtyarddisk-lightglue28.438/3862 s2936 MByes
courtyardloma-b (default)77.038/3885 s3416 MByes
courtyardaliked-flexglue58.5 (58.0-59.1)38/38126 s3098 MByes, DINOv3 licence terms
delivery areaaliked-lightglue37.9 (35.3-40.5)40/4453 s2292 MByes
delivery areadisk-lightglue46.640/4461 s2944 MByes
delivery arealoma-b (default)82.0 (80.8-83.2)44/44101 s3416 MByes
delivery areaaliked-flexglue52.1 (50.1-54.1)44/44118 s3098 MByes, DINOv3 licence terms

Mean over the scenes

front endMip-NeRF 360 AUC@3 (6 scenes)ETH3D AUC@3 (3 scenes)total time Mip / ETH3Dpeak memorycommercial use
aliked-lightglue93.641.9175 s / 77 s1.5 / 2.3 GByes
disk-lightglue94.039.7192 s / 85 s2.6 / 3.0 GByes
loma-b (default)95.972.7256 s / 140 s2.7 / 3.4 GByes
aliked-flexglue93.960.5353 s / 169 s2.5 / 3.1 GByes, DINOv3 licence terms

Recommendation:

  • loma-b (the default) is the most accurate: better than aliked-lightglue on 8 of 9 scenes (+1 to +3 AUC@3 on Mip-NeRF 360, +15 to +52 on the two wide-baseline ETH3D scenes, where it is the only one with correct poses; its one loss, facade, is 3.6 points) and it registers every image. The cost is about 2x the front-end time (1.5x the total with the mapper), 1.5-1.8x the GPU memory and 2.9 GB of weights.
  • aliked-lightglue (--matcher aliked-lightglue) is the fast alternative: the fastest and smallest front end (1.5-2.3 GB peak, 50 MB of weights), registers every image on 8 of the 9 scenes and reaches 91-96 AUC@3 on the Mip-NeRF 360 scenes. Use it when a minute of time or 1 GB of GPU memory matters more than the last points of pose accuracy, or on scenes without wide baselines.
  • disk-lightglue ties aliked-lightglue overall (better on 6 scenes, worse on 3, by -18 to +2.5). aliked-flexglue ties aliked-lightglue on Mip-NeRF 360 and is the best on facade, but 5x slower; its DINOv3 backbone weights carry Meta's DINOv3 licence terms.
  • These are 6 indoor / garden scenes and 3 outdoor building scenes; other image sets can rank differently. Six of the nine scenes were run once; on the repeated ones the results move by up to 1 (facade) to 5 (delivery area) AUC@3 between runs, so differences of that size on the ETH3D scenes are not meaningful.

The default compute dtype (bfloat16 for loma-b) loses no SfM accuracy: in float32 the poses are the same within the run-to-run range (garden 97.7 vs 97.7, facade 59.0 vs 59.8) at 2x the front-end time.

Every single run and the noise measurements are kept in the maintainers' measurement log (2026-11-13, 2026-11-14).