Skip to main content

Lightweight utility package for common computer vision tasks.

Project description

vito - Vision Tools

View on PyPI PyPI - Downloads Build Status Coverage Status License

Python utilities for common computer vision tasks. The goal of this package is to provide a lightweight package helping you with standard/recurring image manipulation tasks.

More advanced functionality is provided by vcp/vitocpp, which is a C++ library with Python 3 bindings.

Examples

  • Pseudocoloring:
    from vito import imutils
    from vito import imvis
    
    # Load a single-channel image (data.dtype will be numpy.uint8)
    peaks = imutils.imread('peaks.png', mode='L')
    # Colorize it
    colorized = imvis.pseudocolor(peaks, limits=None, color_map=colormaps.colormap_viridis_rgb)
    imvis.imshow(colorized)
    
    # Load 16-bit depth stored as PNG (data.dtype will be numpy.int32)
    depth = imutils.imread('depth.png')
    # Colorize it
    colorized = imvis.pseudocolor(depth, limits=None, color_map=colormaps.colormap_turbo_rgb)
    imvis.imshow(colorized)
    
    Exemplary visualizations: colorizing via the turbo rainbow colormap (left); same data reduced to 11 bins colorized using viridis (right). Input data is obtained from two translated and scaled Gaussian distributions. Pseudocoloring Example
  • Optical flow:
    from vito import flowutils
    from vito import imvis
    
    # Load optical flow file
    flow = flowutils.floread('color_wheel.flo')
    # Colorize it
    colorized = flowutils.colorize_flow(flow)
    imvis.imshow(colorized)
    
    Exemplary visualization: Optical flow (standard color wheel visualization) and corresponding RGB frame for one frame of the MPI Sintel Flow dataset. Optical Flow Example
  • Pixelation:
    from vito import imutils
    from vito import imvis
    
    img = imutils.imread('homer.png')
    rects = [(80, 50, 67, 84), (257, 50, 82, 75)]  # (Left, Top, Width, Height)
    anon = imutils.apply_on_bboxes(img, rects, imutils.pixelate)
    imvis.imshow(anon)
    
    Exemplary visualization: anonymization example using imutils.apply_on_bboxes() as shown above, with Gaussian blur kernel (imutils.gaussian_blur(), left) and pixelation (imutils.pixelate(), right), respectively. Anonymization Example
  • For more examples (or if you prefer having a simple GUI to change visualization/analyze your data), see also the iminspect package (which uses vito under the hood).

Dependencies

  • numpy
  • Pillow

Changelog

  • 1.4.1
    • Removes f-strings to fix compatibility for older python 3.5.
  • 1.4.0
    • Changed imvis.overlay to use a more intuitive signature.
    • Aliases for some cam_projections functions.
    • Spell-checked all files via pyspelling.
  • 1.3.4
    • Extended input handling for imutils (support single channel input to rgb2gray).
    • Aliases for some imutils functions.
    • Cleaning up tests, documentation, etc.
  • 1.3.3
    • Prevent nan values caused by floating point precision issues in the cam_projections submodule.
    • Remove the (empty) tracking submodule (to be added in a future release).
    • Update the submodule list.
  • 1.3.2
    • Support custom label maps in detection2d module.
    • Construct BoundingBoxes from relative representations.
  • 1.3.1
    • Relative BoundingBox representation.
    • Support label lookup for Detection instances directly.
  • 1.3.0
    • Common representations and utilities for 2D object detection via the detection2d module.
      • Detection class to encapsulate object detections.
      • BoundingBox class to work with axis-aligned bounding boxes.
  • 1.2.3
    • Support sampling from colormaps.
    • Adjust tests to updated PIL version.
  • 1.2.2
    • Use explicit copies in pseudocolor() to prevent immutable assignment destination errors.
  • 1.2.1
    • Explicitly handle invalid (NaN and infinite) inputs to pseudocolor().
  • 1.2.0
    • Add pixelation functionality for anonymization via imutils.
    • Add Gaussian blur to imutils.
  • 1.1.5
    • Extend projection utils.
  • 1.1.4
    • Explicitly handle None inputs to imutils.
  • 1.1.3
    • Fix transparent borders when padding.
  • 1.1.2
    • Add sanity checks to imutils which prevent interpreting optional PIL/cv2 parameters as custom parameters.
    • Add grayscale conversion to imutils.
  • 1.1.1
    • Maximum alpha channel value derived from data type.
  • 1.1.0
    • Added padding functionality.
  • 1.0.4
    • Improved test coverage.
    • Fixed potential future bugs - explicit handling of wrong/unexpected user inputs.
  • 1.0.3
    • Minor bug fix: handle invalid user inputs in imvis.
  • 1.0.2
    • Additional tests and minor improvements (potential bug fixes, especially for edge case inputs).
    • Ensure default image I/O parametrization always returns/saves/loads color images as RGB (even if OpenCV is available/used on your system).
  • 1.0.1
    • Fix colorizing boolean masks (where mask[:] = True or mask[:] = False).
  • 1.0.0
    • Rename flow package to flowutils.
  • 0.3.2
    • Rename colorization for optical flow.
  • 0.3.1
    • Fix colormaps.by_name() for grayscale.
  • 0.3.0
    • apply_on_bboxes() now supports optional kwargs to be passed on to the user-defined function handle.
    • Changed imread()'s default mode parameter to optional kwargs which are passed on to Pillow.
    • Raising error for non-existing files in imread()
    • Added colormaps.by_name() functionality.
    • Fixed bounding box clipping off-by-one issue.
    • Added imutils tests ensuring proper data types.
  • 0.2.0
    • Optical flow (Middlebury .flo format) I/O and visualization.
    • Support saving images.
    • Visualization utils for tracking results.
  • 0.1.1
    • Changed supported python versions for legacy tests.
  • 0.1.0
    • First actually useful release.
    • Contains most of the functionality of pvt (a library I developed throughout my studies).
      • cam_projections - projective geometry, lens distortion/rectification (Plumb Bob model), etc.
      • colormaps - colormap definitions for visualization (jet, parula, magma, viridis, etc.)
      • imutils - image loading, conversion, RoI handling (e.g. apply functions on several patches of an image).
      • imvis - visualization helpers, e.g. pseudocoloring or overlaying images.
      • pyutils - common python functions (timing code, string manipulation, list sorting/search, etc.)
  • 0.0.1
    • Initial public release.
    • Contains common python/language and camera projection utils.

Project details


Download files

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

Source Distribution

vito-1.4.1.tar.gz (58.9 kB view details)

Uploaded Source

Built Distribution

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

vito-1.4.1-py3-none-any.whl (60.1 kB view details)

Uploaded Python 3

File details

Details for the file vito-1.4.1.tar.gz.

File metadata

  • Download URL: vito-1.4.1.tar.gz
  • Upload date:
  • Size: 58.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1

File hashes

Hashes for vito-1.4.1.tar.gz
Algorithm Hash digest
SHA256 df206db8cf650f8d760a821b9c93363805a0f5d5363d3f8db09cb479fca0a2cb
MD5 e94691dd07a2999f475a6514ffa60b3f
BLAKE2b-256 443baec20e286f71263b120dc59f9a6e9942acdfae6bd3157b9bcc6d5316cdb5

See more details on using hashes here.

File details

Details for the file vito-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: vito-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 60.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1

File hashes

Hashes for vito-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a8744a170968cf8def1af3d6c66a5c3f8ceb4cd0938867b349bbc89dd9c5c733
MD5 b1f5e395d85f7e4a5dfb0f4120736ee3
BLAKE2b-256 94595d458cd219285656ae40e2b7e398908036d8c1aaa56511bcc18a63416e84

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