Video loading and preprocessing utilities for MLX on Apple Silicon
Project description
mlx-video
mlx-video is a small video preprocessing library for MLX on Apple Silicon.
GitHub: https://github.com/AmiraniLabs/mlx-video
It focuses on the first mile of video ML:
- load video files into
mlx.core.array - sample frames at a target FPS
- resize clips for model input
- convert
uint8frames to normalizedfloat32tensors
Install
pip install mlx-video
Publishing
This package is configured for PyPI Trusted Publishing from the
AmiraniLabs/mlx-video GitHub repository using
.github/workflows/publish.yml.
Quickstart
import mlx_video as mv
frames = mv.load("video.mp4", fps=8) # mx.array [T, H, W, C], uint8 RGB
frames = mv.resize(frames, (224, 224)) # spatial resize
frames = mv.normalize(frames) # float32, ImageNet normalized
API
load(path, fps=None, start_time=None, end_time=None, max_frames=None)
Loads a video into a mx.array with shape [T, H, W, C] in RGB order.
resize(frames, size)
Resizes each frame to (height, width).
to_float(frames, scale=True)
Casts frames to float32. By default values are scaled to [0, 1].
normalize(frames, mean=..., std=...)
Applies channel-wise normalization using ImageNet defaults. Integer inputs are automatically converted to floating point and scaled before normalization.
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 mlx_video-0.1.0.tar.gz.
File metadata
- Download URL: mlx_video-0.1.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c5059701cec1db33700dbbb1d63ac2b95edad73974a504ffde28b2b2c396639
|
|
| MD5 |
a42ce197942fc5fc275e5f15aefd0ba1
|
|
| BLAKE2b-256 |
c8f0fbb9393abb8d52f22f52f148f2c28f62cafee11f708459254d5afb71f080
|
Provenance
The following attestation bundles were made for mlx_video-0.1.0.tar.gz:
Publisher:
publish.yml on AmiraniLabs/mlx-video
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mlx_video-0.1.0.tar.gz -
Subject digest:
4c5059701cec1db33700dbbb1d63ac2b95edad73974a504ffde28b2b2c396639 - Sigstore transparency entry: 1108536592
- Sigstore integration time:
-
Permalink:
AmiraniLabs/mlx-video@2d5a4ab061686fb5f91a039ea2959fb2e7c0145b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/AmiraniLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2d5a4ab061686fb5f91a039ea2959fb2e7c0145b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mlx_video-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mlx_video-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 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 |
21f2dffd22654c8818896bd66b31c536769db0e67b1e1ec68fd1be2836e37588
|
|
| MD5 |
82487b99f1bd99c0d484c239159979ad
|
|
| BLAKE2b-256 |
0e9a00fdfeb48a24e3a046e55ffae7b4bc1d1cd5d53cccfbc354af103cb9fdcd
|
Provenance
The following attestation bundles were made for mlx_video-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on AmiraniLabs/mlx-video
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mlx_video-0.1.0-py3-none-any.whl -
Subject digest:
21f2dffd22654c8818896bd66b31c536769db0e67b1e1ec68fd1be2836e37588 - Sigstore transparency entry: 1108536613
- Sigstore integration time:
-
Permalink:
AmiraniLabs/mlx-video@2d5a4ab061686fb5f91a039ea2959fb2e7c0145b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/AmiraniLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2d5a4ab061686fb5f91a039ea2959fb2e7c0145b -
Trigger Event:
workflow_dispatch
-
Statement type: