CLI and Python API for optical flow video processing
Project description
motionflow
CLI and Python API for optical flow video processing.
motionflow input.mp4
Install
pip install motionflow # classical methods only
pip install motionflow[torch] # + RAFT and deep methods
conda install -c conda-forge motionflow # includes PyTorch
pixi global install motionflow # auto-selects GPU/CPU torch
Usage
CLI
# HSV colour-wheel flow (default: Farneback)
motionflow recording.mp4
# RAFT on GPU, heatmap style, every other frame
motionflow recording.mp4 --method raft --device cuda --viz heatmap --stride 2
# Blend flow 40% over original, with temporal smoothing
motionflow recording.mp4 --viz blend --blend 0.4 --smooth 3
# Quiver arrow overlay
motionflow recording.mp4 --viz quiver --quiver-step 24
Python API
from motionflow import process_video
out = process_video(
"recording.mp4",
method="raft",
viz="hsv",
stride=2,
device="auto",
)
Using estimators directly
import cv2
from motionflow.methods import FarnebackFlow
from motionflow.viz import flow_to_hsv
flow = FarnebackFlow()(prev_frame, curr_frame) # (H, W, 2)
vis = flow_to_hsv(flow) # BGR image
Methods
| Method | Type | GPU | Notes |
|---|---|---|---|
farneback |
Dense | No | Default, fast |
tvl1 |
Dense | No | Sharp edges, slow; requires opencv-contrib |
lucas-kanade |
Sparse | No | Good with --viz quiver |
raft |
Dense | Yes | High quality; weights auto-downloaded |
sea-raft |
Dense | Yes | ECCV 2024; coming soon |
neuflow |
Dense | Yes | Edge-optimised; coming soon |
Documentation
roaldarbol.github.io/motionflow
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file motionflow-0.1.0.tar.gz.
File metadata
- Download URL: motionflow-0.1.0.tar.gz
- Upload date:
- Size: 102.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c54356651c4c332add684355d96c89bb33c269fc91b0af20c3ee016587e295c6
|
|
| MD5 |
302c0717f81c92b8b2c42fcac935795d
|
|
| BLAKE2b-256 |
eb148bf3532a6b398c077b42b7b7373056d3442c967590d6fb9c59b952eeff4e
|
Provenance
The following attestation bundles were made for motionflow-0.1.0.tar.gz:
Publisher:
publish.yml on roaldarbol/motionflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
motionflow-0.1.0.tar.gz -
Subject digest:
c54356651c4c332add684355d96c89bb33c269fc91b0af20c3ee016587e295c6 - Sigstore transparency entry: 1074913347
- Sigstore integration time:
-
Permalink:
roaldarbol/motionflow@74074b381eb233063fad7579ab8596d333f1843d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/roaldarbol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@74074b381eb233063fad7579ab8596d333f1843d -
Trigger Event:
push
-
Statement type:
File details
Details for the file motionflow-0.1.0-py3-none-any.whl.
File metadata
- Download URL: motionflow-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ef5476a36f597a06e6f48cb889bb2a7ef1bde6948be93b704bd9a2badd5f98d
|
|
| MD5 |
d22827e4faf8e5ea7147339e44bc04d9
|
|
| BLAKE2b-256 |
6180ddb2c7519e47bfd9d2b135c1ab581b3c0648f910b8b054fbfa7e2d5e44fb
|
Provenance
The following attestation bundles were made for motionflow-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on roaldarbol/motionflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
motionflow-0.1.0-py3-none-any.whl -
Subject digest:
1ef5476a36f597a06e6f48cb889bb2a7ef1bde6948be93b704bd9a2badd5f98d - Sigstore transparency entry: 1074913349
- Sigstore integration time:
-
Permalink:
roaldarbol/motionflow@74074b381eb233063fad7579ab8596d333f1843d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/roaldarbol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@74074b381eb233063fad7579ab8596d333f1843d -
Trigger Event:
push
-
Statement type: