Skip to main content

The Kitware Image Module

GitlabCIPipeline GitlabCICoverage Appveyor Pypi Downloads

The kwimage module handles low-level image operations at a high level.

The kwimage module builds on kwarray and provides tools commonly needed when addressing computer vision problems. This includes functions for reading images, non-maximum-suppression, image warp transformations, and run-length-encoding.

The top-level API is:

from .algo import (available_nms_impls, daq_spatial_nms, non_max_supression,)
from .im_alphablend import (ensure_alpha_channel, overlay_alpha_images,
                            overlay_alpha_layers,)
from .im_core import (atleast_3channels, ensure_float01, ensure_uint255,
                      make_channels_comparable, num_channels,)
from .im_cv2 import (convert_colorspace, draw_boxes_on_image,
                     draw_text_on_image, gaussian_patch, imscale, imresize,)
from .im_demodata import (grab_test_image, grab_test_image_fpath,)
from .im_io import (imread, imwrite,)
from .im_runlen import (decode_run_length, encode_run_length, rle_translate,)
from .im_stack import (stack_images, stack_images_grid,)
from .structs import (Boxes, Coords, Detections, Heatmap, Mask, MaskList,
                      MultiPolygon, Points, PointsList, Polygon, PolygonList,
                      smooth_prob,)
from .util_warp import (subpixel_accum, subpixel_align, subpixel_getvalue,
                        subpixel_maximum, subpixel_minimum, subpixel_set,
                        subpixel_setvalue, subpixel_slice, subpixel_translate,
                        warp_points, warp_tensor,)

NOTE: THE KWIMAGE STRUCTS WILL EVENTUALLY MOVE TO THE KWANNOT REPO

The most notable feature of the kwimage module are the kwimage.structs objects. This includes the primitive Boxes, Mask, and Coords objects, The semi-primitive Points, Polygon structures, and the composite Heatmap and Detections structures (note: Heatmap is just a composite of array-like structures).

The primitive and semi-primitive objects store and manipulate annotation geometry, and the composite structures combine primitives into a single object that jointly manipulates the primitives using warp operations.

The Detections structure is a meta-structure that associates the other more primitive components, and allows a developer to compose them into something that represents objects of interest. The details of this composition are left up to the end-application.

The Detections object can also be “rasterized” and converted into a Heatmap object, which represents the same information, but is in a form that is more suitable for use when training convolutional neural networks. Likewise, the output of neural networks can be directly encoded in a kwimage.Heatmap object. The Heatmap.detect method can then be used to convert the dense heatmap representation into a spare Detections representation that is more suitable for use in an object-detection system. We note that the detect function is not a special detection algorithm. The detection algorithm (which is outside the scope of kwimage) produces the heatmap, and the detect method effectively “inverts” the rasterize procedure of Detections by finding peaks in the heatmap, and running non-maximum suppression.

This module contains data structures for image annotation primitives:

  • Boxes

  • Mask

  • Coords

And composites of these primitives:

  • Detections

  • Polygon

  • MultiPolygon

  • PolygonList

  • MaskList

Metadata

Release files for kwimage 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for kwimage 0.5.2
File Actions
kwimage-0.5.2-py2.py3-none-any.whl Python 2, Python 3 none any Details for kwimage-0.5.2-py2.py3-none-any.whl
kwimage-0.5.2-cp37-cp37m-manylinux2010_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 Details for kwimage-0.5.2-cp37-cp37m-manylinux2010_x86_64.whl
kwimage-0.5.2-cp36-cp36m-manylinux2010_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64 Details for kwimage-0.5.2-cp36-cp36m-manylinux2010_x86_64.whl
kwimage-0.5.2-cp35-cp35m-manylinux2010_x86_64.whl CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.12+ x86-64 Details for kwimage-0.5.2-cp35-cp35m-manylinux2010_x86_64.whl
kwimage-0.5.2-cp27-cp27mu-manylinux2010_x86_64.whl CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.12+ x86-64 Details for kwimage-0.5.2-cp27-cp27mu-manylinux2010_x86_64.whl

Total release size: 2.9 MB

Release files / kwimage-0.5.2-py2.py3-none-any.whl

Download URL kwimage-0.5.2-py2.py3-none-any.whl
Size 150.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
1a1c0716e9c4a606bed6fabe4f457d8a72e1be13e46d28fe5c55beb63a2ea66b
BLAKE2b-256 checksum
How to use checksums
e1b4598a501c23e36cf3e5dc8fdf8957981718a0f462163e1b467909471b0808
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.5

Release files / kwimage-0.5.2-cp37-cp37m-manylinux2010_x86_64.whl

Download URL kwimage-0.5.2-cp37-cp37m-manylinux2010_x86_64.whl
Size 691.1 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
3a810ebd9121627bc3f064011c76f3c577cbac6cdffbb85dc0abea3e20e9610f
BLAKE2b-256 checksum
How to use checksums
48730489569256d3b2a985d001fd80a56bcba62cec0bacf9d61d3bbadebc0fc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.5

Release files / kwimage-0.5.2-cp36-cp36m-manylinux2010_x86_64.whl

Download URL kwimage-0.5.2-cp36-cp36m-manylinux2010_x86_64.whl
Size 693.1 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
9c78401bbda94e8761ace9988e1416989c8a0461f770759584cab5c865c09074
BLAKE2b-256 checksum
How to use checksums
5c4d257cb4b7c7474a67ba6ace2a24b2157588dc1f9ac14c3f7e8dcee2e89623
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.6.9

Release files / kwimage-0.5.2-cp35-cp35m-manylinux2010_x86_64.whl

Download URL kwimage-0.5.2-cp35-cp35m-manylinux2010_x86_64.whl
Size 683.7 kB
Tags CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
3810d489f1d4aebd4650dc2a561b54bc4cd4c058eefe183b72b7f29e985b831e
BLAKE2b-256 checksum
How to use checksums
585f927fa974f327fbac9b2c504f9d562fb45f66f4a2c983feb7d03dbef332ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.5.9

Release files / kwimage-0.5.2-cp27-cp27mu-manylinux2010_x86_64.whl

Download URL kwimage-0.5.2-cp27-cp27mu-manylinux2010_x86_64.whl
Size 713.0 kB
Tags CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
050de4a2ad7e0817632c429e97a029d74b5ffc3125510299201e82709941936a
BLAKE2b-256 checksum
How to use checksums
8958dc6917125e24417970901e5ba11f4c5a7f63315341cf66a3555b210b2289
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/2.7.17

Security for kwimage 0.5.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.5.2 This release

5 release files No 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