Skip to main content
Version: Next

ml.images.explorer

module ml.images.explorer

The image explorer module provides standard helper functions to explore and visualize images


function show_image#

show_image(    image: <built-in function array>,    hide_grid: bool = True,    grid_size=None,    silent_mode: bool = False)

Visualizes an image

Args:

  • `image` (np.array): the image to visualize, represented as numpy array
  • `hide_grid` (bool): indicating if the grid (with the pixel positions) should be hidden
  • `grid_size` ((int, int)): the size of the grid to plot the images in. By default auto size is being applied
  • `silent_mode` (bool): indicates if the image has to be plotted, or just returned

function visualize#

visualize(    image_sets: dict,    image_count: int = 10,    randomize: bool = True,    grid_size=None,    hide_grid: bool = True,    silent_mode: bool = False)

Visualizes the images in the image_sets in a grid

Args:

  • `image_sets` (dict): a dictionary of type (str, list) that indicates the name of an images set and the actual images
  • `image_count` (int): the amount of images to visualize from an image set
  • `randomize` (bool): if True, images will be selected randomly from the imageset, if False, the first n images will be taken
  • `grid_size` ((int, int)): the size of the grid to plot the images in. By default auto size is being applied
  • `hide_grid` (bool): indicates if the grid with pixellocations should be hidden
  • `silent_mode` (bool): indicates if the image has to be plotted, or just returned

Example:

image_sets = {'predicted': y_pred, 'actuals': y_test}

visualize(image_sets, 6, False)


function visualize_classes#

visualize_classes(    image_set: <built-in function array>,    classes: <built-in function array>,    image_count: int = 10,    randomize: bool = True,    grid_size=None,    silent_mode: bool = False)

Visualizes the images from the image_set in a grid and print the corresponding class on the charts

Args:

  • `image_set` (np.array): an array of images to pick from
  • `classes` (np.array): the corresponding labels of the classes for the images
  • `image_count` (int): the amount of images to visualize from an image set
  • `randomize` (bool): if True, images will be selected randomly from the imageset, if False, the first n images will be taken
  • `grid_size` ((int, int)): the size of the grid to plot the images in. By default auto size is being applied
  • `silent_mode` (bool): indicates if the image has to be plotted, or just returned

Example:

image_sets = {'predicted': y_pred, 'actuals': y_test}

visualize(image_sets, 6, False)


This file was automatically generated via lazydocs.