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

Uploaded Python 3

kwimage-0.8.6-cp39-cp39-musllinux_1_1_x86_64.whl (790.2 kB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

kwimage-0.8.6-cp39-cp39-musllinux_1_1_i686.whl (791.8 kB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

kwimage-0.8.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (780.4 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

kwimage-0.8.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (797.7 kB view details)

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

kwimage-0.8.6-cp38-cp38-musllinux_1_1_x86_64.whl (790.5 kB view details)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

kwimage-0.8.6-cp38-cp38-musllinux_1_1_i686.whl (793.6 kB view details)

Uploaded CPython 3.8 musllinux: musl 1.1+ i686

kwimage-0.8.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (779.7 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

kwimage-0.8.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (797.9 kB view details)

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

kwimage-0.8.6-cp37-cp37m-musllinux_1_1_x86_64.whl (781.7 kB view details)

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

kwimage-0.8.6-cp37-cp37m-musllinux_1_1_i686.whl (785.2 kB view details)

Uploaded CPython 3.7m musllinux: musl 1.1+ i686

kwimage-0.8.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (773.3 kB view details)

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

kwimage-0.8.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (792.5 kB view details)

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

kwimage-0.8.6-cp36-cp36m-musllinux_1_1_x86_64.whl (781.9 kB view details)

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

kwimage-0.8.6-cp36-cp36m-musllinux_1_1_i686.whl (785.3 kB view details)

Uploaded CPython 3.6m musllinux: musl 1.1+ i686

kwimage-0.8.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (773.6 kB view details)

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

kwimage-0.8.6-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (792.3 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.6-py3-none-any.whl.

File metadata

  • Download URL: kwimage-0.8.6-py3-none-any.whl
  • Upload date:
  • Size: 251.2 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 62f5af33c406a299f141e224d698418811607c9bede8e9af1866c967d6d4174e
MD5 7d8b0577448402d5a85b62ce2ca48abc
BLAKE2b-256 30d5d378d2158736a3ac5006851a598b60b0aa8360d855ff27911c285d19c6af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.6-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 cca56e323281f80cb35bc8fa80b96417a9ff278f357a5a6073ef3e2231859bd3
MD5 42febf0b3ba0d313057480de62e8a54e
BLAKE2b-256 a1ad3754585dc359ec4871bc4f3993f73e567ac9a143b91d15b6f66beb8f6f91

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.6-cp39-cp39-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 a49e4ad90f0fe8f7f4ba15a6c035a88adb44ba1761dfcdc81b3625e2dfbf41db
MD5 835cccaf47966703f926f2f8740832a1
BLAKE2b-256 7fc9278c67c3f36055ed8af72e4ce724b05d03eaf0f2be23fc2d19996056a1d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3eb912f9b89c1895244e7523b115bc21cc78f8b29b7bede154a930c2b49344db
MD5 6b3e6271fbfa59e82fd1f9a3b44586ea
BLAKE2b-256 b2d05982074e0a529544513d7629fc2e3ed07e3526de2c3ecd7a979546e1f3b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 7ada9987fbfb94d18171744ad735eae6316356d2858b117c19e5a1d46cfbfdf8
MD5 3fdd3d228fbddf42f6f6ee4ad9705796
BLAKE2b-256 6697526712df9c7c97b09fd42fc8ce6542068e400e6a41f632737df782e68e7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.6-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 a29a4151d42e4104c9a3207f634e2fd6d0d51b883b825a22088c95f6d64c8540
MD5 67daa91528e04cbd3f30e8282b8640f3
BLAKE2b-256 c829f100da073c63932c70297431b979afca045d3fba9231d4439ca9be2538ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.6-cp38-cp38-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 b841effb96cd5f359ff69e6d988bca1f9f6caf789607e23c49a95fd46f4b5d27
MD5 3df274948c3f527692b5fdcab1f2fc67
BLAKE2b-256 7770ce62579ac55a3af19416be55d04a6454be2c7a67596ca6f380c648cbc6ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 72f73058a32c627b9129ebb86709a91e6ff1a7fdb927974538360d70b82bb4dc
MD5 f5617f82c2d938cfeb0168efdea43137
BLAKE2b-256 3798eb74ea1034bc8b707f4a2d173c48201487d3431653a35473a48275207429

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 9f7383b429c6f26562ea85ec2fb0580583af710d139c46363f712fbc6335e844
MD5 9f7233107d23825cbf76e7b121ccfa5c
BLAKE2b-256 491f8af3ececc153f541981ecf9cd6af6391b40589868ece4b3671ef001049e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.6-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 a305a1f8787086a891e8b2424174b8fa2bed0099d67ea78eee0784c4a2ccbfaf
MD5 025166241e5f4126d072a18e3fe618c4
BLAKE2b-256 c9a9a2b6419f210880bb0b9ac69776ebe44b571ff35d22ee344852864d84518c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.6-cp37-cp37m-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 cdff0d985bae23e1beca29c02312fac95ff4b2245b543e5928c61afb67c38f7e
MD5 bcc6aec312dd30dca4cbe8fb33220497
BLAKE2b-256 582a0d8aeeb849e941d171a5f993aba0f8fdf1e1efb7565fc3eabbb1b02dc859

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8afe7a8d937c52cb025cce7d6633637099ea852b3f7ca89af708d42b4d517f6d
MD5 d907833e84ddfada9d111136f8ce35ac
BLAKE2b-256 9e65d8427a25a2672f80bb62e56f43b86d585e001f577b5a115463a36efc6543

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 b982c8e2a73bf1562f0d3f9bce25a07947d1b000e5cf1cc584de4bf560d4eeb5
MD5 3bc940ab6555808879cddf630a2ef150
BLAKE2b-256 290fe0040da393447b39072aa97885e2db0b93f15708f2d214aaa2049f308846

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.6-cp36-cp36m-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 1fa7692ec03703067522d994b7684a8aa169e59c2d66d097cc8e0e64ce5ba6ad
MD5 e1bc06ddcbb8add13ac027eb531fd7c7
BLAKE2b-256 4bf0995280a9cc2b3397f7d6b719435e05a7ad6b4c9ec498b1cb33c281fcc118

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.6-cp36-cp36m-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 a70d0af40f0682b8398e43e882c6509b0ef4325f157460304398ab4130e2ba58
MD5 86bf07981afe292cc66f0826d4f84472
BLAKE2b-256 56dfc52a0d8fa38eeaa392263e59ab368e513e69797ad5621750a24d537fc535

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7c354660fb941fa78c386e6946bd41cfb262ca20208792b4ad2585a4e0cc60f7
MD5 4abb3e28cc282fb836d4dbe79a4c867c
BLAKE2b-256 686802191d5bdeea6847fc66f05f8e6f4db502ff10b8b76fc7b0b8e9553998d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kwimage-0.8.6-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a96356ee76fe745dd669a801e70efb94fe156e9bbe73d9d66b5fce1a16f9733f
MD5 736f5faee23e73c75601b07536085734
BLAKE2b-256 0231c385a42c7c7ab35c070cbc26c536e67a2d53eec955ef3ebd51e5ba0ddda0

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