Skip to main content

No project description provided

Project description

GitlabCIPipeline GitlabCICoverage Appveyor Pypi Downloads ReadTheDocs

The main webpage for this project is: https://gitlab.kitware.com/computer-vision/kwimage

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

The core kwimage is a functional library with image-related helper functions that are either unimplemented in or more have a more general interface then their opencv counterparts.

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

The kwimage module is also the current home of my annotation data structures, which provide efficient ways to interoperate between different common annotation formats (e.g. different bounding box / polygon / point formats). These data structures have both a .draw and .draw_on method for overlaying visualizations on matplotlib axes or numpy image matrices respectively.

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_color import (Color,)
from .im_core import (atleast_3channels, ensure_float01, ensure_uint255,
                      make_channels_comparable, num_channels,)
from .im_cv2 import (convert_colorspace, gaussian_patch, imresize, imscale,)
from .im_demodata import (grab_test_image, grab_test_image_fpath,)
from .im_draw import (draw_boxes_on_image, draw_clf_on_image,
                      draw_line_segments_on_image, draw_text_on_image,
                      draw_vector_field, make_heatmask, make_orimask,
                      make_vector_field,)
from .im_filter import (fourier_mask, radial_fourier_mask,)
from .im_io import (imread, imwrite, load_image_shape,)
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,
                      Segmentation, SegmentationList, smooth_prob,)
from .util_warp import (add_homog, remove_homog,
                        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.6.4-py2.py3-none-any.whl (176.1 kB view details)

Uploaded Python 2 Python 3

kwimage-0.6.4-cp38-cp38-manylinux2010_x86_64.whl (672.9 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

kwimage-0.6.4-cp37-cp37m-manylinux2010_x86_64.whl (664.5 kB view details)

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

kwimage-0.6.4-cp36-cp36m-manylinux2010_x86_64.whl (665.2 kB view details)

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

kwimage-0.6.4-cp35-cp35m-manylinux2010_x86_64.whl (656.3 kB view details)

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

kwimage-0.6.4-cp27-cp27mu-manylinux2010_x86_64.whl (680.7 kB view details)

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

File details

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

File metadata

  • Download URL: kwimage-0.6.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 176.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.8

File hashes

Hashes for kwimage-0.6.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 69ed7c4f278b003cb8804aec6f01fc5ba674714ad329526a0208b88b68e92f3d
MD5 94865a8bea5cb799c50c3cd432942aac
BLAKE2b-256 51cd1cb8bfa6e717289842f74233b0659aeedc5d43128a22e5c227bd146f02d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kwimage-0.6.4-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 672.9 kB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for kwimage-0.6.4-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 855fc8c6960501c1999e280f8a2dba719cc96848d19f10958e9f10a20492ffa0
MD5 2219b7c251980da30257f071eed9b6d2
BLAKE2b-256 fe349f372b2ce2d767b4a3712038473437aa3c7fb96de5a2825acd3d00db47b0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kwimage-0.6.4-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 664.5 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.8

File hashes

Hashes for kwimage-0.6.4-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 4f74a8d22fc12f4ce050b03c2d077b6c4b79c10245dc5173a288821ce52c0518
MD5 f1c55f40f75a7b902903cc95aa612088
BLAKE2b-256 02cdf2bbd2927b7b7dd42a7b86f45df0db2ac2f14086dadffdc84d55801b1135

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kwimage-0.6.4-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 665.2 kB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.11

File hashes

Hashes for kwimage-0.6.4-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 a37090e1bb368c520b2c4d22fec3caa3a15a6ad5b80813da4705af259ed984fb
MD5 62a0041ffc802e5bf2312ee3c516d79d
BLAKE2b-256 e9549840379b528ebe2624166c42ae3dc9af7f6cb7c586d1dc425afb18b50bf4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kwimage-0.6.4-cp35-cp35m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 656.3 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.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.5.9

File hashes

Hashes for kwimage-0.6.4-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 f55585ea002196fe85a1c74a318ec78705d1919f6bfce9456799fccaf61bc440
MD5 7a9f74121ac78f643c406fb16e6be549
BLAKE2b-256 e14d0833a41055409259bde40812ab2fca3dea3dcdda767c6bc3fdec527f2c0a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kwimage-0.6.4-cp27-cp27mu-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 680.7 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.24.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/2.7.18

File hashes

Hashes for kwimage-0.6.4-cp27-cp27mu-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 dbcf6c797fa08dd4942373a2b0ca84490b68fc9db8a46f0c6c68358869df8bfd
MD5 a37653832f8ad8884b5e4ccde78c0173
BLAKE2b-256 73ce54f2411e44113825ae9ab29c93a986b2912ad91293afc3ea450d73dba43b

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