A Polars plugin for vision/array operations
Project description
polars-cv
ℹ️ Note: This is a largely AI developed project and still in its early stages. Use at your own discretion.
A Polars plugin for high-performance vision and array operations.
Features
- Modular Pipelines: Define image processing pipelines and apply them to DataFrame columns.
- Expression Arguments: Use Polars expressions for dynamic, per-row parameters.
- Zero-Copy Performance: Efficient memory management with stride-aware operations.
- Multi-Domain: Seamlessly move between images, geometry (contours), and numeric results.
Installation
pip install polars-cv
Quick Start
import polars as pl
from polars_cv import Pipeline
# Define a pipeline and apply it to a column
pipe = Pipeline().source("image_bytes").resize(height=224, width=224).grayscale()
df = pl.DataFrame({"image": [img1_bytes, img2_bytes]})
result = df.with_columns(
processed=pl.col("image").cv.pipe(pipe).sink("numpy")
)
Dynamic Pipelines
Use Polars expressions for per-row parameter values:
pipe = (
Pipeline()
.source("image_bytes")
.resize(height=pl.col("target_h"), width=pl.col("target_w"))
.crop(top=pl.col("crop_y"), left=pl.col("crop_x"), height=100, width=100)
)
df = pl.DataFrame({
"image": [img1_bytes, img2_bytes],
"target_h": [224, 256],
"target_w": [224, 256],
"crop_x": [10, 20],
"crop_y": [5, 15],
})
result = df.with_columns(
processed=pl.col("image").cv.pipe(pipe).sink("numpy")
)
Operations
- Image:
resize,grayscale,blur,threshold,crop,rotate,pad,flip. - Compute:
normalize,scale,clamp,relu,cast. - Geometry:
extract_contours,rasterize,area,perimeter,centroid,bounding_box. - Points:
normalize,translate,scale,rotate,distance,manhattan_distance,distance_to_contour,signed_distance_to_contour,nearest_point_on_contour,angle_to,midpoint,interpolate,within_bbox. - Analysis:
histogram,perceptual_hash,extract_shape. - Reductions:
reduce_sum,reduce_mean,reduce_std,reduce_max,reduce_min,reduce_percentile.
For full details, see the Documentation
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 Distributions
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 polars_cv-0.7.0.tar.gz.
File metadata
- Download URL: polars_cv-0.7.0.tar.gz
- Upload date:
- Size: 771.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 |
ad3d5856b966abaee0540c48a136d75bd44f7f68a982523e71c14332d4163788
|
|
| MD5 |
f163ccffda5bcde9836d3e7aa9eb85bd
|
|
| BLAKE2b-256 |
fa7f89ecc00cb3c1cc453397108e48a31c228b84647906ef6b188ef482a1a8ba
|
Provenance
The following attestation bundles were made for polars_cv-0.7.0.tar.gz:
Publisher:
publish.yml on heshamdar/polars-cv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polars_cv-0.7.0.tar.gz -
Subject digest:
ad3d5856b966abaee0540c48a136d75bd44f7f68a982523e71c14332d4163788 - Sigstore transparency entry: 929944466
- Sigstore integration time:
-
Permalink:
heshamdar/polars-cv@511a80cb9ae2063b144b855067ce5acab005ef5a -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/heshamdar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@511a80cb9ae2063b144b855067ce5acab005ef5a -
Trigger Event:
release
-
Statement type:
File details
Details for the file polars_cv-0.7.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: polars_cv-0.7.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 8.6 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e24f5af35594547fc05151e63043b49b493530ae4981e22ccfc55719f03b3fe2
|
|
| MD5 |
8550337be9e2f1ba15321d0aabbd358f
|
|
| BLAKE2b-256 |
342e205e0eac1ece229f3203a063976a976ab748ac509c82e3fbdb62a1cde75e
|
Provenance
The following attestation bundles were made for polars_cv-0.7.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yml on heshamdar/polars-cv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polars_cv-0.7.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
e24f5af35594547fc05151e63043b49b493530ae4981e22ccfc55719f03b3fe2 - Sigstore transparency entry: 929944472
- Sigstore integration time:
-
Permalink:
heshamdar/polars-cv@511a80cb9ae2063b144b855067ce5acab005ef5a -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/heshamdar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@511a80cb9ae2063b144b855067ce5acab005ef5a -
Trigger Event:
release
-
Statement type:
File details
Details for the file polars_cv-0.7.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: polars_cv-0.7.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 7.8 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
883862cdd34c0daadfec6eaf560110018e53ab3321d8b42fa0ea9162b69ce843
|
|
| MD5 |
0724ac23857891e84780a7ad89f8d868
|
|
| BLAKE2b-256 |
78f433557a1e89bdebe4fd931b0cd6892fc11a07ea444436e496a871a03e23e5
|
Provenance
The following attestation bundles were made for polars_cv-0.7.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
publish.yml on heshamdar/polars-cv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polars_cv-0.7.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
883862cdd34c0daadfec6eaf560110018e53ab3321d8b42fa0ea9162b69ce843 - Sigstore transparency entry: 929944467
- Sigstore integration time:
-
Permalink:
heshamdar/polars-cv@511a80cb9ae2063b144b855067ce5acab005ef5a -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/heshamdar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@511a80cb9ae2063b144b855067ce5acab005ef5a -
Trigger Event:
release
-
Statement type:
File details
Details for the file polars_cv-0.7.0-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: polars_cv-0.7.0-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 7.5 MB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8b77827823f2efa9c80cdede89d24f9243cfa70a893623264225304e09737d5
|
|
| MD5 |
edcd4966818c755f16ae3ef829902ec7
|
|
| BLAKE2b-256 |
2dd6dceac682fedb9d5cc515ed9b130ae7441bcab4ecb6d861b32dbd23df5a76
|
Provenance
The following attestation bundles were made for polars_cv-0.7.0-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
publish.yml on heshamdar/polars-cv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polars_cv-0.7.0-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
e8b77827823f2efa9c80cdede89d24f9243cfa70a893623264225304e09737d5 - Sigstore transparency entry: 929944471
- Sigstore integration time:
-
Permalink:
heshamdar/polars-cv@511a80cb9ae2063b144b855067ce5acab005ef5a -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/heshamdar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@511a80cb9ae2063b144b855067ce5acab005ef5a -
Trigger Event:
release
-
Statement type: