imgread_benchmark
Benchmark for read images with different libs.
List Available Image Libraries
UV_CACHE_DIR=.uv-cache uv run imgread_benchmark libs
Dataset Management
You can download standard datasets for benchmarking using the imgread_benchmark data subcommand.
Imagenette
To download the full Imagenette dataset:
uv run imgread_benchmark data imagenette
To download a specific size (e.g., 160px or 320px):
uv run imgread_benchmark data imagenette --size 160
Datasets are stored in the .data/ directory by default.
Add External Backend Plugin (No Repo Code Changes)
imgread_benchmark discovers external backends via Python entry points.
You do not need to modify this repository to add your backend.
- Create a plugin package (local or published) with an adapter module.
- Expose your backend via entry point group
imgread_benchmark.img_libs. - Install the plugin package into the same environment as
imgread_benchmark. - Verify with
imgread_benchmark libs.
Minimal adapter example (my_backend_plugin.py):
from PIL import Image
import numpy as np
def read_img(path: str):
return read_img_ndarray(path)
def read_img_pil(path: str) -> Image.Image:
with Image.open(path) as img:
return img.convert("RGB")
def read_img_ndarray(path: str) -> np.ndarray:
return np.asarray(read_img_pil(path))
def is_available() -> bool:
return True
Plugin pyproject.toml:
[project]
name = "my-backend-plugin"
version = "0.1.0"
dependencies = ["imgread_benchmark", "pillow", "numpy"]
[project.entry-points."imgread_benchmark.img_libs"]
my_backend = "my_backend_plugin"
Install plugin into current environment:
UV_CACHE_DIR=.uv-cache uv pip install -e /path/to/my-backend-plugin
Verify discovery and run benchmark:
UV_CACHE_DIR=.uv-cache uv run imgread_benchmark libs
UV_CACHE_DIR=.uv-cache uv run imgread_benchmark /path/to/images -l my_backend
Notes:
read_img,read_img_pil, andread_img_ndarrayare optional individually.- For
-t def, backend should provideread_img. - For
-t pil, backend should provideread_img_pil. - For
-t np, backend should provideread_img_ndarray. - If plugin name conflicts with a built-in backend name, built-in backend wins.
- Built-in backends are listed first; additional and plugin backends are appended.
Install Local Rust/PyO3 Backend
Example installing a local backend crate into this project environment:
env -u CONDA_PREFIX \
PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 \
UV_CACHE_DIR=.uv-cache \
/path/to/maturin develop --manifest-path /path/to/backend/Cargo.toml --uv
Then verify:
UV_CACHE_DIR=.uv-cache uv run imgread_benchmark libs
Metadata
Release files for imgread_benchmark 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| imgread_benchmark-0.3.1.tar.gz | 13.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| imgread_benchmark-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.5 kB
Release files / imgread_benchmark-0.3.1.tar.gz
| Download URL | imgread_benchmark-0.3.1.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41e55c14ac48b0ee12027579645ba297f1cfe1b43a17acf29dc3401f06716162
|
|
BLAKE2b-256 checksum How to use checksums |
48a32251d1c74adffcaff23848f171e282372d4659ff834dbe574684e4f0eb9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / imgread_benchmark-0.3.1-py3-none-any.whl
| Download URL | imgread_benchmark-0.3.1-py3-none-any.whl |
|---|---|
| Size | 23.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d7f1dd82d300468c0c0e28bf6afdc50ab97ee3d26c6000726a2c6867d1179b5c
|
|
BLAKE2b-256 checksum How to use checksums |
83e8b171dc15aacd11ac7675b2dfb5138673695e97128bef48317472f5a6dbf6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|