utils#

Classes

AddTensors

Adds all its inputs together.

MinMaxNormalize

Albumentations transform that normalizes image to desired min and max values.

Parallel

Passes inputs through multiple `nn.Module`s in parallel. Returns a tuple of outputs.

SplitTensor

Wrapper around torch.split

Functions

adjust_conv_channels(old_conv, in_channels)

channel_groups_to_imgs(x, channel_groups)

color_to_triple([color])

Given a PIL ImageColor string, return a triple of integers representing the red, green, and blue values.

compute_conf_mat(out, y, num_labels)

compute_conf_mat_metrics(conf_mat, label_names)

deserialize_albumentation_transform(tf_dict)

Deserialize an albumentations transform serialized by serialize_albumentation_transform().

plot_channel_groups(axs, imgs, channel_groups)

serialize_albumentation_transform(tf[, ...])

Serialize an albumentations transform to a dict.

validate_albumentation_transform(tf_dict)

Validate a serialized albumentation transform by attempting to deserialize it.