The kwimage_ext Module
Read the docs |
|
Gitlab (main) |
|
Pypi |
The kwimage_ext module contains acceleration extensions used by kwimage. Normal installs are Rust-first: the public compatibility API is implemented in Python and dispatches supported kernels to the kwimage_ext._rust PyO3 extension.
Install a released wheel in the usual way:
python -m pip install kwimage_ext
Building from source requires a Rust toolchain because the normal PEP-517 backend is maturin. CMake and Cython are not required for the production wheel; they are only needed by maintainers when building the historical parity backend.
Rust-first development
The default PEP-517 build uses maturin and installs the Rust extension as kwimage_ext._rust. The public Python modules remain compatibility shims, so downstream kwimage imports do not need to change while kernels are ported.
For an editable Rust build:
./dev/build_rust.sh python -m pytest tests/test_rust_backend.py tests/test_rust_shims.py
The historical Cython/C sources are retained temporarily as a parity reference. To rebuild both implementations and require direct semantic parity:
./dev/check_backend_parity.sh
dev/build_legacy.sh is available when only the reference extensions are needed. It builds CPU reference modules under explicit *_legacy names; those binaries are not part of the normal wheel.
Backend selection is capability-aware: a Rust module is selected only when it implements every symbol required by a particular shim. Set KWIMAGE_EXT_FORCE_RUST=1 to prove that a test is not accidentally falling through to a legacy extension. KWIMAGE_EXT_FORCE_LEGACY=1 is intended for maintainer diagnostics only.
The Rust module also exposes narrow coco-assignment capabilities through kwimage_ext.algo.assignment. coco_greedy_match batches IoU thresholds; coco_greedy_match_grid additionally batches independent area/ignore slices so downstream evaluators can cross the Python/Rust boundary once per image. Both accept an already-built CSR sparse candidate graph plus stable prediction order / truth flags. Geometry and metric policy remain outside these kernels; downstream kwcoco retains Python reference implementations and fallbacks. Direct kernel parity and timing can be checked with:
KWIMAGE_EXT_FORCE_RUST=1 python -m pytest -q tests/test_rust_assignment.py python dev/bench_assignment.py --n-pred=400 --n-true=400 --candidates=40
Release wheels use PyO3 abi3-py310. Build one CPython 3.10 baseline wheel per platform and test that same artifact on every supported Python version. The artifact-level check is:
python dev/check_wheel_artifact.py wheelhouse/kwimage_ext*.whl
Release evidence audit
For release candidates, validate the built wheel, not an editable checkout. The artifact validator first checks the archive structure, then installs the wheel into a temporary target directory and requires every imported kwimage_ext module (including algo.assignment and _rust) to resolve from that isolated target. This prevents source-tree imports or stale editable .pth files from hiding an incomplete release artifact:
python dev/validate_wheel_artifact.py wheelhouse/kwimage_ext*.whl
For a local release candidate, the deterministic preflight is:
./dev/build_release_candidate.sh _release_candidate
That command always builds a fresh non-editable wheel, validates the isolated install/capability surface, runs the release-packaging guards, records SHA256 hashes and wheel contents, and emits an uploadable evidence bundle. dev/validate_rust_port.sh performs the same non-editable wheel audit in addition to the editable development tests. End-to-end COCO metric speed / memory comparisons remain owned by kwcoco because only the full evaluator can make a meaningful comparison against pycocotools.COCOeval.
Release files for kwimage-ext 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| kwimage_ext-0.4.1-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| kwimage_ext-0.4.1-cp310-abi3-musllinux_1_2_x86_64.whl | CPython 3.10 | abi3 | Linux musl 1.2+ x86-64 | Details |
| kwimage_ext-0.4.1-cp310-abi3-musllinux_1_2_aarch64.whl | CPython 3.10 | abi3 | Linux musl 1.2+ ARM64 | Details |
| kwimage_ext-0.4.1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| kwimage_ext-0.4.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| kwimage_ext-0.4.1-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
| kwimage_ext-0.4.1-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 2.9 MB
Release files / kwimage_ext-0.4.1-cp310-abi3-win_amd64.whl
| Download URL | kwimage_ext-0.4.1-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 292.6 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
78ea83431d036e62d89bf8f7d0b9a6bd0fa30f8e5651c90efd69f65c34445be9
|
|
BLAKE2b-256 checksum How to use checksums |
31ffd6ee539460ec23980f9033f4fce2986370daf8936a1e7bf5f3922324ed20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / kwimage_ext-0.4.1-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | kwimage_ext-0.4.1-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 500.8 kB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
95da4c841a2e6fe93612be4c22a2bba8a98b12fcf4cf88ed4527c643dda8cd6e
|
|
BLAKE2b-256 checksum How to use checksums |
5085ac5a7f8cce7c1050749f678fd0f54ce86bc73f0768083b654b4c3981d46c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / kwimage_ext-0.4.1-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | kwimage_ext-0.4.1-cp310-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 480.0 kB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
fff7dd719556f0241dc79b8674f04f6ac002c44d906d5abbdf112b70a8990b17
|
|
BLAKE2b-256 checksum How to use checksums |
ac8ddb60da21c498821910068e76ff30412ebe4d43fcd0c889a3f4710fe2fff2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / kwimage_ext-0.4.1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | kwimage_ext-0.4.1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 429.4 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5aec76fc60de1f29dd313b0ff264346954c148f63ed12ae4caba12650a334158
|
|
BLAKE2b-256 checksum How to use checksums |
bf8e46594fcf7ed8a45258870e48c1df8de820da76bc67c718169ce8443ad214
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / kwimage_ext-0.4.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | kwimage_ext-0.4.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 413.6 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
cfdf1b6272b18b96639755970485f9a0d02a24f393df99063824a4391af0454d
|
|
BLAKE2b-256 checksum How to use checksums |
101ff50a72f76463fade6ef94a9382e1657f83224c13884020e2350e34b641fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / kwimage_ext-0.4.1-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | kwimage_ext-0.4.1-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 373.6 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9143bcdda6e711f23b5c967ee916eefb20328a2a41dc48a48844a76d5c9e3728
|
|
BLAKE2b-256 checksum How to use checksums |
0265adb8229f369b09c5fce49f5147b408fab821481fa9094fe03b150220154c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / kwimage_ext-0.4.1-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | kwimage_ext-0.4.1-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 383.1 kB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
9fff472c98c94473a909ec7f2e5c5d29e9f2cf04dcd1392c9b57b7091a2c02b8
|
|
BLAKE2b-256 checksum How to use checksums |
422e926b3ee42429fc839e7a4e5d039870df3288b748e47ed6e9c678f9efb1fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency log