Skip to main content

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 three image annotation primitives:

  • Boxes # technically this could be made out of Coords and renamed to VectorCoords

  • Mask # likewise this could be renamed to RasterCoords

  • Coords #

These primative structures are used to define these metadata-containing composites:

  • Detections

  • Polygon

  • Heatmap

  • MultiPolygon

  • PolygonList

  • MaskList

All of these structures have a self.data attribute that holds a pointer to the underlying data representation.

Some of these structures have a self.format attribute describing the underlying data representation.

Most of the compositie strucutres also have a self.meta attribute, which holds user-level metadata (e.g. info about the classes).

Release files for kwimage 0.5.7

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.7
File
kwimage-0.5.7-py2.py3-none-any.whl Python 2, Python 3 none any Details
kwimage-0.5.7-cp37-cp37m-manylinux2010_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 Details
kwimage-0.5.7-cp36-cp36m-manylinux2010_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64 Details
kwimage-0.5.7-cp35-cp35m-manylinux2010_x86_64.whl CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.12+ x86-64 Details
kwimage-0.5.7-cp27-cp27mu-manylinux2010_x86_64.whl CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.12+ x86-64 Details

Total release size: 3.0 MB

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

Download URL kwimage-0.5.7-py2.py3-none-any.whl
Size 157.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
956e8fe971537961b249166a4895b61dee542bac7062efdbae595d337ea06f82
BLAKE2b-256 checksum
How to use checksums
8d9a9ccda7b84563c60621188b5ce51f1f5a52e155b7d726158eec74b39ec000
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

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

Download URL kwimage-0.5.7-cp37-cp37m-manylinux2010_x86_64.whl
Size 698.4 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
f90d97d6b2b00e5bf3c32120f8ed2f88e824398afe8413652e7a8f0cc5deb774
BLAKE2b-256 checksum
How to use checksums
0c8762aeb020f91dfd794eaeebdfb8ddf58ee1f32ccfd42b896a548098887a09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

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

Download URL kwimage-0.5.7-cp36-cp36m-manylinux2010_x86_64.whl
Size 700.4 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
9686d90892625fffbbe4d288f2866723cb8163f8d2b90f2997b76d249a4237d8
BLAKE2b-256 checksum
How to use checksums
f8f15b90037424ce3873113ecb6ff36635a5a0a005e78e2f67268de5f996f1b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.10

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

Download URL kwimage-0.5.7-cp35-cp35m-manylinux2010_x86_64.whl
Size 691.0 kB
Tags CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
2c75dd7fc9fe1afa9011e9c505ce9b1213cabe76dd7c8da7659cb001b6f3363b
BLAKE2b-256 checksum
How to use checksums
6ecf4676b4ff5978ba800f34df67ffd4cf37db562a11434a7e64e4a576beac2a
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/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.5.9

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

Download URL kwimage-0.5.7-cp27-cp27mu-manylinux2010_x86_64.whl
Size 720.3 kB
Tags CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
ce447e661f838b516381f623795f5b76466fb4869abfbb70e94462ddd1526baa
BLAKE2b-256 checksum
How to use checksums
ba7ec72994aa62bf8c421c39c3dd0b1b749b0eb9287d035124e6e75199609b5e
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/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/2.7.17

Release history Release notifications | RSS feed

0.12.0

2 release files

0.11.6

2 release files

0.11.4

2 release files

0.11.2

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.2

2 release files

0.10.1

1 release file

0.10.0

1 release file

0.9.25

1 release file

0.9.24

1 release file

0.9.23

1 release file

0.9.22

1 release file

0.9.20

1 release file

0.9.19

1 release file

0.9.18

1 release file

0.9.17

1 release file

0.9.16

1 release file

0.9.15

1 release file

0.9.14

1 release file

0.9.13

1 release file

0.9.12

1 release file

0.9.11

1 release file

0.9.10

1 release file

0.9.9

1 release file

0.9.8

1 release file

0.9.7

1 release file

0.9.6

1 release file

0.9.5

1 release file

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.6

17 release files

0.8.5

17 release files

0.8.3

17 release files

0.8.2

17 release files

0.8.0

8 release files

0.7.13

9 release files

0.7.12

9 release files

0.7.11

9 release files

0.7.9

9 release files

0.7.8

9 release files

0.7.7

9 release files

0.7.6

9 release files

0.7.5

1 release file

0.7.4

5 release files

0.7.3

6 release files

0.7.2

5 release files

0.7.1

5 release files

0.7.0

4 release files

0.6.10

4 release files

0.6.7

4 release files

0.6.6

4 release files

0.6.5

5 release files

0.6.4

6 release files

0.6.2

6 release files

0.6.1

6 release files

0.6.0

6 release files

0.5.8

6 release files

This release

0.5.7 This release

5 release files

0.5.6

5 release files

0.5.5

5 release files

0.5.4

5 release files

0.5.3

5 release files

0.5.2

5 release files

0.5.1

4 release files

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