Skip to main content

visionpipe

English | 简体中文

A small collection of practical computer-vision helpers for Python.

The package is under active development. Its public API is intentionally small and may change before version 1.0.

Features

  • Prepare a dataset from a directory of images and videos
  • Read video metadata without decoding frames
  • Extract sampled frames from video with rotation handling
  • Rewrite images and record metadata as JSONL

Requirements

  • Python 3.12 or newer (CI tests 3.12–3.15 on Linux and Windows)
  • NumPy, OpenCV, PyAV, and tqdm are installed as runtime dependencies

Installation

pip install visionpipe

For development, see the Development section below.

Quick start

Prepare a dataset

import visionpipe as vp

vp.dataset.Dataset("data/root")

Dataset moves media files found directly under data/root into data/root/raw/, then processes them in place. Run it on a directory you intend to reorganize.

Before:

data/root/
├── still.jpg
└── video.mp4

After:

data/root/
├── raw/
│   ├── still.jpg
│   └── video.mp4
├── interim/
│   └── images/
│       ├── i<image-md5-prefix>/
│       │   └── <image-md5-prefix>.jpg
│       └── v<video-md5-prefix>/
│           └── <video-md5-prefix>_<frame>.jpg
└── metadata/
    └── metadata.jsonl

Read video metadata

import visionpipe as vp

meta = vp.video.get_video_meta("data/root/raw/video.mp4")
print(meta["width"], meta["height"], meta["fps"], meta["rotation"])

Extract video frames

import visionpipe as vp

vp.video.extract_video_frames(
    "data/root/raw/video.mp4",
    save_root="output/frames",
    meta_dir="output/meta",
    step_seconds=1,
)

Public API

Call Purpose Notes
vp.dataset.Dataset Prepare a dataset from images and videos Moves media into raw/; writes interim/images/ and metadata.jsonl
vp.video.get_video_meta Read video metadata width and height are post-rotation
vp.video.extract_video_frames Extract sampled video frames Rotates pixels; output JPEGs have no EXIF orientation
vp.image.rewrite_img Rewrite an image and record its metadata Writes JSONL metadata and a content-addressed image
vp.file.append_jsonl Append a JSON record Creates parent directories; skips exact duplicates
vp.file.calc_hash Compute a file hash MD5 by default; reads the full file

Development

Install the project and its development tools once, or after changing dependencies:

# --extra dev installs the tools from [project.optional-dependencies].dev
uv sync --extra dev

Linting and formatting

ruff check only reports problems by default. Add --fix to apply the automatic fixes for rules that provide one.

# 1. Preview safe lint fixes without writing files.
uv run --extra dev ruff check --fix --diff .

# 2. Apply safe lint fixes, such as import order.
uv run --extra dev ruff check --fix .

# 3. Verify that no lint issues remain.
uv run --extra dev ruff check .

Apply lint fixes before formatting, so the formatter has the final say on layout.

# 1. Preview which files would change.
#    --diff prints the changes without writing any files.
uv run --extra dev ruff format --diff .

# 2. Apply formatting.
uv run --extra dev ruff format .

# 3. Verify formatting.
#    --check fails if any file still needs formatting.
uv run --extra dev ruff format --check .

Ruff flag reference

Flag Applies to Meaning
--fix ruff check Apply safe fixes to files.
--diff ruff check, ruff format Show changes without writing them.
--check ruff format Check only; exit non-zero if changes are needed.

Type checking and tests

These are the final checks after linting and formatting. CI runs the same checks.

# Static type checking.
uv run --extra dev mypy

# Run the test suite.
uv run --extra dev pytest

Check that the package imports:

python -c "import visionpipe; print(visionpipe.__version__)"

Layout

src/visionpipe/   package source
tests/            automated tests
pyproject.toml    packaging and tool configuration

License

MIT. See LICENSE.

Metadata

Release files for visionpipe 0.1.0

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

Source distribution (sdist)

Source distribution for visionpipe 0.1.0
File Size Uploaded Provenance
visionpipe-0.1.0.tar.gz 16.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for visionpipe 0.1.0
File Interpreter ABI Platform
visionpipe-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.9 kB

Release files / visionpipe-0.1.0.tar.gz

Download URL visionpipe-0.1.0.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e8ef7c48119c22e2238df1e61ba08d2d22d200fbbc7a33c621cce28758f83d35
BLAKE2b-256 checksum
How to use checksums
6393e12044b929158e7622a9ff3976923534fc23af66f41a76bdecee73564f1f
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 Oct 22, 2026.

Transparency log

Release files / visionpipe-0.1.0-py3-none-any.whl

Download URL visionpipe-0.1.0-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a09ee1e00b2f29d4d88b31fcda1dacf9a077c739e339b56ab4ef7f51ba4dc211
BLAKE2b-256 checksum
How to use checksums
bae4499efc14e4858aaf8a990629a3470496b421d42aa2ca38f861003e050123
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 Oct 22, 2026.

Transparency log

Security for visionpipe 0.1.0

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 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for visionpipe-0.1.0.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 Oct 22, 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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