Skip to main content

SfM Tool

CI codecov

A tool for creating and exploring Structure from Motion (SfM) reconstructions, built on COLMAP and OpenCV.

The documentation is at sfmtool.github.io, built from the sfmtool/sfmtool.github.io repository.

Under construction - project is being restructured to better fit what it evolved into.

Components

  • sfm CLI - Create workspaces, run SfM solves, and inspect reconstructions
  • SfM Explorer GUI - View reconstructions in 3D, explore tracks and camera rays
  • Python bindings - Access SfM functionality from Python via sfmtool-py

Quick Start

# Create a workspace with your images
mkdir -p workspace/images
cp /path/to/images/*.jpg workspace/images/
cd workspace

# Initialize and solve
sfm ws init .
sfm solve -g images/

# Inspect the result
sfm inspect sfmr/[filename].sfmr

Convert videos to image sequences

To try many different things with a particular 3D reconstruction, having the data as a video complicates individual frame access. Therefore the sfm command expects you to always convert to images first.

Here's an example of using ffmpeg to convert a single video in the current directory into a sequence of images in a frames subdirectory:

# Assumes there's one video in the current directory
VIDEO_FILE=$(echo *.mp4)

IMAGE_BASE=$(basename "$VIDEO_FILE")
IMAGE_BASE=${IMAGE_BASE%.*}

mkdir -p frames
ffmpeg -i "$VIDEO_FILE" \
    -qscale:v 2 \
    frames/"${IMAGE_BASE}_%04d.jpg"

Building

This project uses Pixi for environment management with Rust and Python.

# Run the Sfm Explorer GUI
pixi run gui

# Run tests
pixi run test

Project Structure

crates/
  sfmtool-archive-io/       Shared ZIP + zstd container primitives
  sfmtool-sfmr-format/      .sfmr reconstruction file I/O
  sfmtool-sift-format/      SIFT feature file I/O
  sfmtool-matches-format/   Feature matches file I/O
  sfmtool-camrig-format/    .camrig camera-rig file I/O
  sfmtool-kdf-format/       .kdf kd-forest file I/O
  sfmtool-colmap/           COLMAP integration
  sfmtool-core/             Core project functionality
  sfm-explorer/             SfM Explorer GUI
  sfmtool-py/               Python bindings

License

Apache-2.0

The JPEG encoder in the compiled extension is based in part on the work of the Independent JPEG Group; see THIRD-PARTY-NOTICES.md.

Metadata

Release files for sfmtool 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sfmtool 0.4
File Size Uploaded Provenance Actions
sfmtool-0.4.tar.gz 6.5 MB With provenance Details for sfmtool-0.4.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for sfmtool 0.4
File Interpreter ABI Platform Actions
sfmtool-0.4-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for sfmtool-0.4-cp314-cp314-win_amd64.whl
sfmtool-0.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64 Details for sfmtool-0.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
sfmtool-0.4-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for sfmtool-0.4-cp314-cp314-macosx_11_0_arm64.whl

Total release size: 81.4 MB

Release files / sfmtool-0.4.tar.gz

Download URL sfmtool-0.4.tar.gz
Size 6.5 MB
Tags Source
SHA-256 checksum
How to use checksums
baeb4e0de6c5406784bd6c3298a4c8e94f1e6ccf539f2bb27997451250187f34
BLAKE2b-256 checksum
How to use checksums
e93f00a3f35aac7ca864dec2119dbc0b46f5ca60cc4af7133e848e355261c98e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / sfmtool-0.4-cp314-cp314-win_amd64.whl

Download URL sfmtool-0.4-cp314-cp314-win_amd64.whl
Size 23.9 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
e7bd01a0d4176c809b6f96efe632868ee545f01040c9b14965be675824411a56
BLAKE2b-256 checksum
How to use checksums
b3b6b91ca82f134b5fb55ad12dec25df239c1f61e874b0101544106b50763ab8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / sfmtool-0.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL sfmtool-0.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 28.6 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
3eca2c7898b994ebc6d93fb270580df5274e282a9fbd6f26e408f68f837fdc97
BLAKE2b-256 checksum
How to use checksums
8e35f27e0320fa75a167c366dff4cde8e1f87620027f2d7db5aef5df6e6ec2fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / sfmtool-0.4-cp314-cp314-macosx_11_0_arm64.whl

Download URL sfmtool-0.4-cp314-cp314-macosx_11_0_arm64.whl
Size 22.4 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f26a84693440b9076eef5938d777c843eafb67c5d1cbd016d22fb4e17470a313
BLAKE2b-256 checksum
How to use checksums
220ecb7e2b62aa4bf749ed803a4247384ed6bf73abe10197cf046a8aa97f591b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for sfmtool 0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for sfmtool-0.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page