Epipole

Epipole is GPU Structure-from-Motion in C++17 and CUDA: 3D reconstruction from photos, with camera poses and a sparse point cloud, on an NVIDIA GPU or the CPU. Every stage has both versions, and they give the same results. No OpenCV, no Ceres.

What it does

Structure-from-Motion recovers where each photo was taken and a 3D model of the scene from the photos alone. Epipole does it the way COLMAP does, incrementally, with every stage in CUDA:

Results

DatasetImagesRegisteredRotation error (median)COLMAP
Bunny (included)36360.17°0.28°
ETH3D courtyard38380.030°0.034°
ETH3D delivery_area, one camera2372370.20°0.46°
Middlebury templeRing47470.13°0.18°
ETH3D delivery_area, four-camera rig9489480.09°–

Errors against each dataset's ground truth, with each dataset's tuned config. ETH3D and Middlebury data are not included in the repository.

CPU or GPU

ConfigImagesCPUGPUSpeed-up
Bunny, ORB361.3 s0.62 s2.1×
Bunny, SIFT368.3 s0.79 s10×
Middlebury templeRing4734 s3.4 s10×
ETH3D courtyard (1550×1032)38245 s4.1 s60×
ETH3D delivery_area, one camera23741 s6.5 s6×

Ryzen 7 9700X (16 threads) against an RTX 5060 Ti; both give the same result on each. Measured with bench_stages (best of 3 after a warm-up; a single sfm_run of the bunny takes 0.9 s), default configs.

Against COLMAP

COLMAP 4.2.1 built with CUDA, on the bunny with the same masks and fixed intrinsics: 2.5 s and 0.28° (extraction, matching and mapping on the GPU), against 0.77 s and 0.17° here. On the CPU COLMAP takes 4.0 s, Epipole 8.3 s.

Get started

git clone https://github.com/Sovik-Ghosh/sfm-cuda.git
cd sfm-cuda
cmake --preset release && cmake --build --preset release -j    # CUDA 13, RTX 20xx to 50xx
# or, without an NVIDIA GPU:  cmake --preset cpu && cmake --build --preset cpu -j
./build/release/inference/apps/sfm_run configs/bunny_sift_tuned2.json
./build/release/inference/apps/sfm_viewer outputs/bunny-sift-tuned2

# your own photos: any names, portrait and landscape, focal length from EXIF
./build/release/inference/apps/sfm_run --images path/to/photos

# or from Python
pip install . && python -c "import epipole; print(epipole.run('configs/bunny_sift_tuned2.json').metrics)"

Prebuilt Linux binaries (CPU-only and CUDA) are attached to the latest release. Your own photos: sfm_run --images on a folder of JPEGs (portrait and landscape, focal length from EXIF); see Use your own images. "colmap_scene": true writes the images/ + sparse/0 folder that 3D Gaussian Splatting and nerfstudio open directly.