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.1

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.1
File Size Uploaded Provenance Actions
sfmtool-0.4.1.tar.gz 6.6 MB With provenance Details for sfmtool-0.4.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for sfmtool 0.4.1
File Interpreter ABI Platform Actions
sfmtool-0.4.1-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for sfmtool-0.4.1-cp314-cp314-win_amd64.whl
sfmtool-0.4.1-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.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
sfmtool-0.4.1-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for sfmtool-0.4.1-cp314-cp314-macosx_11_0_arm64.whl

Total release size: 81.9 MB

Release files / sfmtool-0.4.1.tar.gz

Download URL sfmtool-0.4.1.tar.gz
Size 6.6 MB
Tags Source
SHA-256 checksum
How to use checksums
423da8a61fa00cba1ce7945d1613e5787ff8ad00f52ba9612d27774e5c3ed9d5
BLAKE2b-256 checksum
How to use checksums
04e25c946017cd84dcb2aef69fe2aaf361914fc28a2a1ab21e647f49c5c72881
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 19, 2026.

Transparency log

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

Download URL sfmtool-0.4.1-cp314-cp314-win_amd64.whl
Size 24.1 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
4e55025650ca82691cc69e3648ac650f353882a28b7918cfeef568bde7963457
BLAKE2b-256 checksum
How to use checksums
71e1920af5a78605286f5cc48df24727bae2126377d653811bcf0ba1138b4665
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 19, 2026.

Transparency log

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

Download URL sfmtool-0.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 28.7 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1a43196255083ac87be4c28d1cc9e33993aa88467372a5eb2ab76fc0eba70f67
BLAKE2b-256 checksum
How to use checksums
ec2148837f74e39d1e4fef59670c1f1006bc3126abf5ea4932c7bcb1f3393765
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 19, 2026.

Transparency log

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

Download URL sfmtool-0.4.1-cp314-cp314-macosx_11_0_arm64.whl
Size 22.6 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0599ef629d326d4275e7a2ea3e938053905d161591e9bb1350f7fb71ea51e84c
BLAKE2b-256 checksum
How to use checksums
61addfb9e6c918c1871ca390d89e02c2549d069e8673fbac2604fbdc1e24e90f
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 19, 2026.

Transparency log

Security for sfmtool 0.4.1

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.1.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 19, 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