Skip to main content

TraceWave video tracking pipeline using SAM2

Project description

TraceWave Pipeline

TraceWave is a video tracking pipeline that runs SAM2 on frame sequences, produces per-frame CSV summaries, and exports annotated videos.

What You Get

  • Annotated MP4 outputs per chunk (and a merged MP4).
  • Per-frame CSVs per chunk (and a merged CSV).
  • A CLI for running the pipeline over frame folders and prompt YAMLs.

Requirements

  • Python 3.10+
  • SAM2 (installed automatically via pip)
  • CUDA GPU recommended for speed (CPU is supported but slow)

Install (PyPI)

pip install tracewave

Checkpoints (Auto-Download)

TraceWave automatically downloads the required SAM2 checkpoint on first run if it is missing. By default, checkpoints are stored in:

~/.cache/tracewave/sam2/checkpoints

You can also pre-download all checkpoints:

tracewave-download-checkpoints

To change the checkpoint location:

  • SAM2_CHECKPOINT_DIR=/path/to/checkpoints

To disable auto-download:

  • TRACEWAVE_AUTO_DOWNLOAD=0

Dev Helper (SAM2 + Checkpoints)

If you prefer a local clone of SAM2 (for development), you can still use:

make install

This creates a venv, installs TraceWave in editable mode, clones SAM2 into third_party/sam2, and downloads checkpoints.

Configure SAM2 (optional)

If SAM2 lives somewhere else, set:

  • SAM2_ROOT=/path/to/sam2 (should contain sam2/ and checkpoints/)
  • SAM2_MODEL=tiny|small|base_plus|large (default: large)

Usage

Run the pipeline:

tracewave -i /path/to/frames -o /path/to/output -p /path/to/prompts.yaml

Generate a tasks file for batch runs:

tracewave-gen-tasks /path/to/root -o tasks.tsv

Prompt YAML Format

Prompt files must contain a top-level prompts list. See src/tracewave/prompts/parser.py for the exact schema and examples.

Outputs

Given frame_dir=/data/frames/clipA, outputs are:

  • /output/clipA.csv (merged CSV)
  • /output/clipA.mp4 (merged annotated video)
  • /output/clipA_tmp/ (intermediate chunk files; removed if --del_tmp is set)

Build + Verify Before Publishing

Use these make targets to validate the package before uploading to PyPI:

python -m pip install --upgrade build twine
make build
make test-install
make check-dist

What they do:

  • make build: builds sdist + wheel into dist/
  • make test-install: installs the wheel into a clean venv and verifies tracewave imports and CLI help
  • make check-dist: runs twine check dist/*

Development

Create a dev environment (with SAM2):

make install

Run the pipeline (after install):

make run ARGS="-i /path/to/frames -o /path/to/output -p /path/to/prompts.yaml"

Troubleshooting

  • If SAM2 configs or checkpoints are missing, TraceWave will raise a clear error with the expected paths.
  • Set HYDRA_FULL_ERROR=1 for detailed SAM2 errors.

License

See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tracewave-0.1.0.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tracewave-0.1.0-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file tracewave-0.1.0.tar.gz.

File metadata

  • Download URL: tracewave-0.1.0.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tracewave-0.1.0.tar.gz
Algorithm Hash digest
SHA256 df22328e356e52a415e82e683cf40952393be028841a44d490c735ecfd78bedc
MD5 67247f02238088f0e3839abfa534b8bb
BLAKE2b-256 76470983d2f9d2b53df0a4c9470ccd2c8ac0ddb4cadcdc88e1f90e3e95dd5def

See more details on using hashes here.

Provenance

The following attestation bundles were made for tracewave-0.1.0.tar.gz:

Publisher: publish.yml on StevetheGreek97/TraceWave-pipeline

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tracewave-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tracewave-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tracewave-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67e87f8b44c807cf674e84d976575df040bbe5d18d7240f95d2ec2f6232f12c8
MD5 b554ad778f1c7b3f888aee7a619a68ec
BLAKE2b-256 c33001bc9239d5e9412eecddbd38d554ba9b0e0db6a5720690b7f0e5d19237ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for tracewave-0.1.0-py3-none-any.whl:

Publisher: publish.yml on StevetheGreek97/TraceWave-pipeline

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page