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


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.8.4-py3-none-any.whl (248.8 kB view details)

Uploaded Python 3

kwimage-0.8.4-cp39-cp39-musllinux_1_1_x86_64.whl (787.8 kB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

kwimage-0.8.4-cp39-cp39-musllinux_1_1_i686.whl (789.4 kB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

kwimage-0.8.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (778.0 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

kwimage-0.8.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (795.3 kB view details)

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

kwimage-0.8.4-cp38-cp38-musllinux_1_1_x86_64.whl (788.2 kB view details)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

kwimage-0.8.4-cp38-cp38-musllinux_1_1_i686.whl (791.2 kB view details)

Uploaded CPython 3.8 musllinux: musl 1.1+ i686

kwimage-0.8.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (777.3 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

kwimage-0.8.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (795.6 kB view details)

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

kwimage-0.8.4-cp37-cp37m-musllinux_1_1_x86_64.whl (779.4 kB view details)

Uploaded CPython 3.7m musllinux: musl 1.1+ x86-64

kwimage-0.8.4-cp37-cp37m-musllinux_1_1_i686.whl (782.8 kB view details)

Uploaded CPython 3.7m musllinux: musl 1.1+ i686

kwimage-0.8.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (770.9 kB view details)

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

kwimage-0.8.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (790.2 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

kwimage-0.8.4-cp36-cp36m-musllinux_1_1_x86_64.whl (779.5 kB view details)

Uploaded CPython 3.6m musllinux: musl 1.1+ x86-64

kwimage-0.8.4-cp36-cp36m-musllinux_1_1_i686.whl (782.9 kB view details)

Uploaded CPython 3.6m musllinux: musl 1.1+ i686

kwimage-0.8.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (771.2 kB view details)

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

kwimage-0.8.4-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (789.9 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

File details

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

File metadata

  • Download URL: kwimage-0.8.4-py3-none-any.whl
  • Upload date:
  • Size: 248.8 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 de4a43cc74d3d7319ea4f119d961d747758563e337917e3a32196a5ad69d1f59
MD5 98019a2acc87a0c40513ca9a26c03b83
BLAKE2b-256 8dc50a42e396caf08a554c4ee916ab64b1f012abb5b5701c09c7a2eaedd7d5fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.4-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 398e1bfc6652a3136d02007f5068a9bd7df3ecb7082394e24ba00c31329954f7
MD5 e983e5ff2dba04c8184aa6dab8e92a5e
BLAKE2b-256 b89d3c2abfa2eb9d0fd7618c45b15c1efb4764fe9181331903d9cb6692ccdf84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.4-cp39-cp39-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 f1dfd1caa5794f6fda7adf0025077e54916796fb0fa18df7530dd8d5fb964365
MD5 d1c60c49ab0ee830ecada91a18f7185a
BLAKE2b-256 caf01348bf0d83b2c5a2fa75e85bbe6330c0a93b7a4ab10c2dfba3cd00353e32

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4216317b124d6ef381331ab32079b40d2109b7c8d9d8a91241905fa22d3fca3e
MD5 a0691e5da91c0edfd29b955eadaa2ba9
BLAKE2b-256 6f5299908de3cbbb1a2d49b6620f271f4f49b42dfc93ddb786a4127f0dec6711

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 3abe6a3c48f3a483de02b5c43ce3d604ab56f38d6d662a09a74699785877c9be
MD5 5866afd1bc7c92fe8abe5c7c16d3573c
BLAKE2b-256 7202ee7a3c206caa5d4c5356a7282ab6c61b4e5ca88d2e9b87ed73cfcb17ea31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.4-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 26fa29fc867b20716c5e21af90802682e862094c3ae7b336164a71470b7885de
MD5 6a434168039c6903491be5958ef66eb7
BLAKE2b-256 797e0048185f55f44ea0526cc94e197f03a89a5910703f0bf7a74a882f09f6f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.4-cp38-cp38-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 4ac414386ca18cb75b09b930d12a178f0952bb1d2cf0e091cc86ec9d6867ffcb
MD5 cde24fc695697615fe54c997320037bf
BLAKE2b-256 7e71de371c1a4396e363a36377651cd1a368457ebe3b342a0a8e7292b8a35dd4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 74e308fd58664a671d678251af92ebcf3a54add804bacfc72893e4510c931c3c
MD5 df171b40c397c382f12232b87239649c
BLAKE2b-256 a2218304a0ef55a4126d16122d3fca4adf1e064b5e94e2af68104c66be64d3c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 5bd8b54a8766c5fef5d90ae3f2576ad2a63c394407af6e2b212b416269d316bd
MD5 b21956222b36d9e5042cac27b337824d
BLAKE2b-256 ee6d2f88725bb89cc0f373f744e139aba6a7af95a503b5c1e5e16de58865f83d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.4-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 2e7704c08c1689a940adb98a93746b7beb1121150e33a56430db191d78d23341
MD5 ba54d124835a9fc0699f229744013a12
BLAKE2b-256 c8b6ce94266deefca53f474fa6abfa08a01cff9d4a95397775ed67b03262f0a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.4-cp37-cp37m-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 4e73efe22e50a3b46a61988fcbc75a144f8fbb53eefea67791f1d497e4cebacf
MD5 1f1b5039359190a9ace7b60debb4544b
BLAKE2b-256 46ec04ce55245d0e2073d3a1f45e9d89dc4b45fb5494439575959a8069a3e1a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9e8f7113b0d85067ac61ad3154b3caff1593fdcd0dfad87e5f36ae7d6fd2a15f
MD5 5fab86d859d95d1fdf120ca1b5367406
BLAKE2b-256 dac90a9b3a8812686f4598728f774a73d72c3e4545ea5631ad0708886de62997

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 6322dd41c5a377475c5229402284d72d517250c0316407991e85ce4db1d3b58b
MD5 2057bce0f3b647361317f5a6bfe57ed2
BLAKE2b-256 28df6a6e35c086f52d6f62b12153fd5f2f49accb0e9df78342b5cdb21fde04d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.4-cp36-cp36m-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 63ec251a10f388cf92b00d8ff2da3ba9f373ee85c38d11c383696ece001cac69
MD5 8d65a1a909c8a4148151a9a85d945785
BLAKE2b-256 43c5ae33848d8afb0238c73cd83a03d87d89a0ff89a4a38b2f0ddbbe37ddf82c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.4-cp36-cp36m-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 2f83e5d69cd02cec6b964683159b87489bf8e7db6ff9e833aefa67dbffd665e6
MD5 c9a23bbe7a0b1590197204393eab28c1
BLAKE2b-256 d378b2977ad48288b36ae7237036b47f48597864ce48d10d686853c7dd22e5df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4627c3710085197bed338e5cecd0cb09dff876be17c4634439028bf554e12b25
MD5 9cb2463190ab0f79198e5ec0ed8b8d75
BLAKE2b-256 f64f5db4bddb378dd9985c3a6e2b757f3a7d2803baf30b493a615591cb35906f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.4-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 3c656cf86d329ed9b87452956b355d1c6eaaf81c0353e9e921991551bd6c4ac9
MD5 2a3a9c802e543edd6d4f020cc73703bc
BLAKE2b-256 89db5852feb07106327cc936737ce7f286810e0d6113f96143dc237f103ef172

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