data_visualization

Description

Helper functions for visualization and analysis of image datasets.

Functions

apply_mask(img, mask[, color, alpha])

Apply monochrome (possibly non-binary) mask to image of same size with alpha value.

apply_masks(img, masks[, colors, alphas])

compare_masks(*masks[, colors])

Merge several monochrome masks in different colors into the same image.

mean_proportion_pos_px(masks)

From the given samples, calculate the mean of the proportion of positive pixels per mask.

neg_pixel_prop(data[, max_num_samples, ...])

Collect the mean proportion of negative pixels in the binary segmentation mask data.

to_img(tens)

Transform a (cuda) tensor to a PIL.Image.Image.

to_monochrome_img(img_t)

torch.Tensor to monochrome PIL.Image.Image in 'L' (=8-bit) mode.

visualize_classification_data(dataset[, ...])

Visualize a dataset yielding tuples of the form (input, target_class_identifier).

visualize_mask_transforms(titled_datasets[, ...])

Visualize difference between original and the transformed masks of datasets.

visualize_segmentation_data(dataset[, ...])

Visualize a dataset yielding tuples of the form (input, target_mask).