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,
                      find_robust_normalizers, make_channels_comparable,
                      normalize, normalize_intensity, num_channels,
                      padded_slice,)
from .im_cv2 import (convert_colorspace, gaussian_blur, gaussian_patch, imcrop,
                     imresize, imscale, morphology, warp_affine,)
from .im_demodata import (checkerboard, grab_test_image,
                          grab_test_image_fpath,)
from .im_draw import (draw_boxes_on_image, draw_clf_on_image, draw_header_text,
                      draw_line_segments_on_image, draw_text_on_image,
                      draw_vector_field, fill_nans_with_checkers,
                      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 .transform import (Affine, Linear, Matrix, Projective, Transform,
                        profile,)
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_image,
                        warp_points, warp_tensor,)

NOTE: THE KWIMAGE STRUCTS WILL EVENTUALLY MOVE TO THE KWANNOT REPO (But this transition might take awhile)

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, probably not for efficiency and decoupling

  • Mask # likewise this could be renamed to Raster

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

Installation

There are a few small quirks with installing kwimage. There is an issue with the opencv python bindings such that we could rely on either the opencv-python or opencv-python-headless package. If you have either of these module already installed you can simply pip install kwimage without encountering any issues related to this. But if you do not already have a module that provides import cv2 installed, then you should install kwimage with one of the following “extra install” tags:

# We recommend using the headless version
pip install kwimage[headless]

# OR

# If other parts of your system depend on the opencv qt libs
# (this can conflict with pyqt5)
pip install kwimage[graphics]

On linux, pip install commands will download precompiled manylinux wheels. On other operating systems, or if you are installing from source, you may need to compile C-extension modules. However, there are equivalent python-only implementations of almost every c-extension. You can disable compilation or loading of c-extensions at compile or runtime by setting the environment variable: KWIMAGE_DISABLE_C_EXTENSIONS=1.

Also note, that when building from source, the build may fail if you not in a fresh state (related to skbuild-386. You can mitigate this by running python setup.py clean to remove build artifacts. Building from a clean environment should work.

A Note on GDAL

The kwimage library can use GDAL library for certain tasks (e.g. IO of geotiffs). GDAL can be a pain to install without relying on conda. Kitware also has a pypi index that hosts GDAL wheels for linux systems:

pip install --find-links https://girder.github.io/large_image_wheels GDAL

Project details


Release history Release notifications | RSS feed

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

If you're not sure about the file name format, learn more about wheel file names.

kwimage-0.8.5-py3-none-any.whl (249.7 kB view details)

Uploaded Python 3

kwimage-0.8.5-cp39-cp39-musllinux_1_1_x86_64.whl (788.7 kB view details)

Uploaded CPython 3.9musllinux: musl 1.1+ x86-64

kwimage-0.8.5-cp39-cp39-musllinux_1_1_i686.whl (790.3 kB view details)

Uploaded CPython 3.9musllinux: musl 1.1+ i686

kwimage-0.8.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (778.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

kwimage-0.8.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (796.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

kwimage-0.8.5-cp38-cp38-musllinux_1_1_x86_64.whl (789.0 kB view details)

Uploaded CPython 3.8musllinux: musl 1.1+ x86-64

kwimage-0.8.5-cp38-cp38-musllinux_1_1_i686.whl (792.0 kB view details)

Uploaded CPython 3.8musllinux: musl 1.1+ i686

kwimage-0.8.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (778.1 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

kwimage-0.8.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (796.4 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

kwimage-0.8.5-cp37-cp37m-musllinux_1_1_x86_64.whl (780.2 kB view details)

Uploaded CPython 3.7mmusllinux: musl 1.1+ x86-64

kwimage-0.8.5-cp37-cp37m-musllinux_1_1_i686.whl (783.7 kB view details)

Uploaded CPython 3.7mmusllinux: musl 1.1+ i686

kwimage-0.8.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (771.8 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

kwimage-0.8.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (791.0 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

kwimage-0.8.5-cp36-cp36m-musllinux_1_1_x86_64.whl (780.4 kB view details)

Uploaded CPython 3.6mmusllinux: musl 1.1+ x86-64

kwimage-0.8.5-cp36-cp36m-musllinux_1_1_i686.whl (783.7 kB view details)

Uploaded CPython 3.6mmusllinux: musl 1.1+ i686

kwimage-0.8.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (772.1 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ x86-64

kwimage-0.8.5-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (790.8 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

File details

Details for the file kwimage-0.8.5-py3-none-any.whl.

File metadata

  • Download URL: kwimage-0.8.5-py3-none-any.whl
  • Upload date:
  • Size: 249.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.13

File hashes

Hashes for kwimage-0.8.5-py3-none-any.whl
Algorithm Hash digest
SHA256 418723c3c1598843b6b2380e7dbff8dbb0d66cc9640167481ff2fbd8415cfc36
MD5 35d9d1ac80e4575b11406cc78d9a496b
BLAKE2b-256 8c0244e7b59672490bec72c9989949ca1d4ee62f6d380a1b15b8930b9ee9aa41

See more details on using hashes here.

File details

Details for the file kwimage-0.8.5-cp39-cp39-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for kwimage-0.8.5-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 5b4cc4ce619ffbe0480e8306ee4d6d0289e4fcdb0e95058106037db059cfc300
MD5 aea10b108867d7d16fc04d2e140b3e1f
BLAKE2b-256 d61a5e36bb706eb8957e98e4e84428c789e5fde3ba47d1c7cca55eecb34d844d

See more details on using hashes here.

File details

Details for the file kwimage-0.8.5-cp39-cp39-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for kwimage-0.8.5-cp39-cp39-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 570b36750c0ea07ea65ce71f53b31550ae6462af89b770d3b0b4efe84bcbdac3
MD5 77cd0a01228cdc64ce1c55109bf62433
BLAKE2b-256 0ea9ce3458f1d49b7087f7423b463e4976a2b854e0ff5d0b39f51fae751e834d

See more details on using hashes here.

File details

Details for the file kwimage-0.8.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kwimage-0.8.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1cb55cb64933f8848ac423d34c62ec7db3601023acbaa545c50a36ef7362815a
MD5 60768379a27f31fd6572e685e757ee42
BLAKE2b-256 f60e8dde44e8f04376d28de2dab70550dc92d894824460d56c465879acf1213d

See more details on using hashes here.

File details

Details for the file kwimage-0.8.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for kwimage-0.8.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 589a354c2cce8f83452e996b3acc18d59005caa961a1f267fc123a296c6b1a2b
MD5 5bcd289d06b93de65ad2f89c4e9f63cb
BLAKE2b-256 edcdff35f8c1e6c75a36f7604cd6cfa1d36a21affb3ed5d791476ba45a48f2a0

See more details on using hashes here.

File details

Details for the file kwimage-0.8.5-cp38-cp38-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for kwimage-0.8.5-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 fc33cef4a7ebf575ff2896ea0682c671aa57de945b9e9286ae2efd33e6aaa734
MD5 8f511764300c7444060191d5723de9b7
BLAKE2b-256 732214c006fb452f9cf9da39c758390543dc3e42e914e43ade931666cbc1cfcf

See more details on using hashes here.

File details

Details for the file kwimage-0.8.5-cp38-cp38-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for kwimage-0.8.5-cp38-cp38-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 bde2221974f599097cc07ee853e4a9ec8ccea5068a0ef50d1190d3170def892f
MD5 d0d958a81096ced605cf86e285c21130
BLAKE2b-256 6da2f45ee15df7e089046a6e6e02402d5a4043e73d610d0b9d3ee6736b14f409

See more details on using hashes here.

File details

Details for the file kwimage-0.8.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kwimage-0.8.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 57670b04f5295e52ecc565f3167f37af2c8decbb13eb39f684f49ab703a7c033
MD5 02ccb70054ff16f7ce3793f26f07a680
BLAKE2b-256 662d9a2e8e1610984bdce0c4ff5098a70a5c4d86fe793a4d4053281f58674209

See more details on using hashes here.

File details

Details for the file kwimage-0.8.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for kwimage-0.8.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 ac6351f37dc79d7d1d3b08aee62732b31effaa72616c0c9cca7adbb2c6d974bc
MD5 5593a291fa4398cc7f5b5c632d20748a
BLAKE2b-256 3cba76e26ce6898a3639380fdf6bdc40cd385acd4fa7532e267e58238e7525f4

See more details on using hashes here.

File details

Details for the file kwimage-0.8.5-cp37-cp37m-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for kwimage-0.8.5-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 94f6a73101557ab5046046fd9eba3d4b36f9638ebfdfb5ade3c6dd25f773e82c
MD5 03e45f49b8ef11e319ad7c0ab126b692
BLAKE2b-256 ee04f135fecbe9f4e550e8e0834fa44d695308dc29b6979f660f85c92cea48ec

See more details on using hashes here.

File details

Details for the file kwimage-0.8.5-cp37-cp37m-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for kwimage-0.8.5-cp37-cp37m-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 4597e4be4ad9ceee0da18a4e949dc40cc59ee33ed28753a690a08f31ee6601ce
MD5 fc4c0ff9d46596bfe292aa1bc6c3b4d5
BLAKE2b-256 ae7621bfd55220d3bbebda34291c4ff60c1c045fd61061f8f09028e769049a40

See more details on using hashes here.

File details

Details for the file kwimage-0.8.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kwimage-0.8.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 da1081ddfb992880d43ddf1e90f0c65da6ad78251d2a6ff6be091315d0063b79
MD5 519eac0f1ebd61fcd4f90f36b2659490
BLAKE2b-256 46a1660ee85a7fe3333fa7fe7c063b740e93862385061411e71fefceb7ee1c71

See more details on using hashes here.

File details

Details for the file kwimage-0.8.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for kwimage-0.8.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 0d7ca98e9f9614130dc55a54884f757f62d16cdad54de3bc485c566981f9bda2
MD5 bfca5abd86c7fe0c42275a3d3da8de2b
BLAKE2b-256 54e533a5eb1a927469188a8a88384c237be52d1e0ccb85179ce795ceb71254a1

See more details on using hashes here.

File details

Details for the file kwimage-0.8.5-cp36-cp36m-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for kwimage-0.8.5-cp36-cp36m-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 291ed4fbaaf8655e1376a36ff52618e31b34854ab53a2b6da9100aa06eaa067b
MD5 16a774b689e28ddfd54febb1e1fee6a5
BLAKE2b-256 1aef6d148b68d63964ed45c3a273241da9ad14946ba317d2405dee6110e02fba

See more details on using hashes here.

File details

Details for the file kwimage-0.8.5-cp36-cp36m-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for kwimage-0.8.5-cp36-cp36m-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 aa174e32711ca089485ba098e135bf11a32c62aad27681ccafc71101a9c7ddf7
MD5 0aeca1710d640f197c1a8139c671d557
BLAKE2b-256 a18209391cabc7f4adda742dcac95cb0ae3cc20901189393aafe130df17ee656

See more details on using hashes here.

File details

Details for the file kwimage-0.8.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kwimage-0.8.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1fffd32d459407e23005a213be51f8cf4a2d5eb894b9c7593a2e08b73757d37c
MD5 8063ffa7de6291939b8610b5527fcc82
BLAKE2b-256 6326c9adfb8ec481a6919c47bd9dcda76a3560e9d5cf282477648da408cdd5b2

See more details on using hashes here.

File details

Details for the file kwimage-0.8.5-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for kwimage-0.8.5-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 b0059f9d8dc848e9da31e5fb139abc5e81261d7f0029a5769e99c0d50b0685d7
MD5 220cba17699afe5b3b6b80622bb0ad5f
BLAKE2b-256 72f4f7c55c53221f2e830eec2522259d6db371897bdf4947182ad0eb4609053a

See more details on using hashes here.

Supported by

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