virelay.image_processing

Contains some helper functions for processing images.

Module Attributes

BorderMethod

Represents the different methods that can be used to create a border around an image.

Functions

add_border(image, new_width, new_height, method)

Up-samples the specified image, by making a border around the image.

center_crop(image, new_width, new_height)

Crops the image evenly on all sides to the desired size.

generate_heatmap_image_black_fire_red(...)

Generates a heatmap with a gray background, where red tones are used to visualize positive relevance values and blue tones are used to visualize negative relevances.

generate_heatmap_image_black_green(...)

Generates a heatmap with a black background, where green tones are used to visualize positive relevance values and blue tones are used to visualize negative relevances.

generate_heatmap_image_black_yellow(...)

Generates a heatmap with a black background, where yellow tones are used to visualize positive relevance values and blue tones are used to visualize negative relevances.

generate_heatmap_image_gray_red(attribution_data)

Generates a heatmap with a gray background, where red tones are used to visualize positive relevance values and blue tones are used to visualize negative relevances.

generate_heatmap_image_using_matplotlib(...)

Generates a heatmap from the specified attribution data using the color maps provided by Matplotlib.

render_heatmap(attribution_data, color_map)

Takes the raw attribution data and converts it so that the data can be visualized as a heatmap.

render_superimposed_heatmap(...)

Renders the heatmap an superimposes it onto the specified image.