Skip to main content

mlx-vision

Image preprocessing and Apple Vision framework interop for MLX on Apple Silicon.

mlx-vision provides two layers:

  • MLX-native image loading and preprocessing for model pipelines
  • optional Apple Vision framework integration for OCR, face detection, classification, and saliency

GitHub: https://github.com/AmiraniLabs/mlx-vision

Install

Base install:

pip install mlx-vision

With Apple Vision support:

pip install mlx-vision[vision]

Development install:

pip install mlx-vision[dev]

Full install:

pip install mlx-vision[all]

Quickstart

import mlx_vision as mv

image = mv.load("photo.jpg")
image = mv.resize(image, (256, 256))
image = mv.center_crop(image, (224, 224))
image = mv.normalize(image)
image = mv.to_chw(image)

Batch Loading

import mlx_vision as mv

batch = mv.load_batch(["a.jpg", "b.jpg"], size=(224, 224))
batch = mv.normalize(batch)
batch = mv.to_chw(batch)

Apple Vision Integration

import mlx_vision as mv

if mv.is_vision_available():
    faces = mv.detect_faces("portrait.jpg")
    text = mv.detect_text("document.jpg")
    classes = mv.classify_image("photo.jpg")
    saliency = mv.attention_saliency_map("photo.jpg")

API

Core image preprocessing:

  • load(path, color="rgb")
  • load_batch(paths, color="rgb", size=None)
  • resize(image, size, interpolation="linear")
  • center_crop(image, size)
  • pad(image, padding, fill=0, mode="constant")
  • horizontal_flip(image)
  • to_float(image, scale=True)
  • normalize(image, mean=..., std=...)
  • to_chw(image)
  • to_hwc(image)

Apple Vision framework:

  • is_vision_available()
  • detect_faces(image)
  • detect_text(image, recognition_level="accurate", languages=None)
  • classify_image(image)
  • saliency_map(image, kind="attention")
  • attention_saliency_map(image)

Positioning

What mlx-vision is:

mlx-vision is the image and computer vision entry point for MLX pipelines on Apple Silicon. It provides model-ready image transforms and optional access to Apple's native Vision framework with outputs compatible with MLX workflows.

What it is not:

  • not a full replacement for OpenCV
  • not a training framework
  • not a visionOS SDK
  • not a general multimedia library

Publishing

This package is configured for PyPI Trusted Publishing from the AmiraniLabs/mlx-vision GitHub repository using .github/workflows/publish.yml.

Metadata

Release files for mlx-vision 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 mlx-vision 0.1.0
File Size Uploaded Provenance Actions
mlx_vision-0.1.0.tar.gz 9.9 kB With provenance Details for mlx_vision-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 18.3 kB

Release files / mlx_vision-0.1.0.tar.gz

Download URL mlx_vision-0.1.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fd234ee8f3efc0f1046def7a432a3011e321074811112eda496aa0c958ef1b64
BLAKE2b-256 checksum
How to use checksums
af777ed138f8f231665e975406188cbe4f82db60403578959b11deec540603b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 16, 2026.

Transparency log

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

Download URL mlx_vision-0.1.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d37b604aa5051e4280548f6514818bc35f1938ed89393a2331114ad931a54baf
BLAKE2b-256 checksum
How to use checksums
9fb75695d83b811113fff8f94cfc4e7f38a9dff711b0304df9e7686db2e9d8fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 16, 2026.

Transparency log

Security for mlx-vision 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 mlx_vision-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 Mar 16, 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