Skip to main content

No project description provided

Project description

GitlabCIPipeline GitlabCICoverage Appveyor Pypi Downloads ReadTheDocs

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.

Read the docs at: http://kwimage.readthedocs.io/en/master/

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).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

kwimage-0.5.8-py2.py3-none-any.whl (158.7 kB view details)

Uploaded Python 2 Python 3

kwimage-0.5.8-cp38-cp38-manylinux2010_x86_64.whl (710.3 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

kwimage-0.5.8-cp37-cp37m-manylinux2010_x86_64.whl (699.2 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

kwimage-0.5.8-cp36-cp36m-manylinux2010_x86_64.whl (701.2 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

kwimage-0.5.8-cp35-cp35m-manylinux2010_x86_64.whl (691.8 kB view details)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

kwimage-0.5.8-cp27-cp27mu-manylinux2010_x86_64.whl (721.1 kB view details)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ x86-64

File details

Details for the file kwimage-0.5.8-py2.py3-none-any.whl.

File metadata

  • Download URL: kwimage-0.5.8-py2.py3-none-any.whl
  • Upload date:
  • Size: 158.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.6

File hashes

Hashes for kwimage-0.5.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d054601b9512a447dd9ac02956a2023e7ddb957282363519f56c9712a7fac512
MD5 4fe11f7f99e4d76a00d9547baade141c
BLAKE2b-256 1c1f81a154036fd4815dbb1edcca0138404cc0a8dc478f68a6f432e52dd83065

See more details on using hashes here.

File details

Details for the file kwimage-0.5.8-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: kwimage-0.5.8-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 710.3 kB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.1

File hashes

Hashes for kwimage-0.5.8-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 6c68cec8deae3de2e9b4aa080477c3e3e4be9b7f3998c7ffb2243725decacf87
MD5 b0dc5b450cf8f893cb881d7ad3af3767
BLAKE2b-256 0d257397c4d16cbe00e3f530855ba548bec9e3da87cbe0363b5e511d71e1a9e7

See more details on using hashes here.

File details

Details for the file kwimage-0.5.8-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: kwimage-0.5.8-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 699.2 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.6

File hashes

Hashes for kwimage-0.5.8-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 06d44cc6d3350a1e338fd1b0ae22339126fa7a349bc809dcb33f8b99a3fd8b8b
MD5 0eb8e84f31cc00a58bf52a5cd2f98c3e
BLAKE2b-256 68e57d1bbec2554b1b9c2d1789d322c0389104f02d50be4f03cd701b26a4a27b

See more details on using hashes here.

File details

Details for the file kwimage-0.5.8-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: kwimage-0.5.8-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 701.2 kB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.10

File hashes

Hashes for kwimage-0.5.8-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 86ee7459d30f4782b7cd26c4c8d10ed558e54c8b7af8084a2d56eba6e1586aab
MD5 2d2d05f37ab34a05e51bacb5fdc62a60
BLAKE2b-256 63fcc574cc4b5ce7e8eede144e1e690cf4fb3155db2d513bbd50d531615dbf2d

See more details on using hashes here.

File details

Details for the file kwimage-0.5.8-cp35-cp35m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: kwimage-0.5.8-cp35-cp35m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 691.8 kB
  • Tags: CPython 3.5m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.5.9

File hashes

Hashes for kwimage-0.5.8-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 2cafc258bf57e0e70105fa952aadc1628f8b3563c90981c47e87c431c8b99666
MD5 5caa9c3484f80e0343c596bd49a9d4c8
BLAKE2b-256 444710629c7eb6442c56736a2d47e797aef6af4309602e0c252fb3db7f586797

See more details on using hashes here.

File details

Details for the file kwimage-0.5.8-cp27-cp27mu-manylinux2010_x86_64.whl.

File metadata

  • Download URL: kwimage-0.5.8-cp27-cp27mu-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 721.1 kB
  • Tags: CPython 2.7mu, manylinux: glibc 2.12+ x86-64
  • Uploaded using 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.42.0 CPython/2.7.17

File hashes

Hashes for kwimage-0.5.8-cp27-cp27mu-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 4eac51741aaab6a86578986f957129888cdf2468eee04b50baf11d6f05ad88af
MD5 eeaa08b3921d9b240829c10bcb8915f6
BLAKE2b-256 6a604b6d1254f2f8bdbce815395a7a5659a370695843b832949c411be8a73101

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page