utils¶

Define utility layers and operators for models in tiatoolbox.

Functions

argmax_last_axis

Define the post-processing of this class of model.

centre_crop

A function to center crop image with given crop shape.

centre_crop_to_shape

A function to center crop image to shape.

compile_model

A decorator to compile a model using torch-compile.

is_torch_compile_compatible

Check if the current GPU is compatible with torch-compile.

nms_on_detection_maps

Apply NMS to pre-processed peak maps to handle cross-channel conflicts.

peak_detection_map_overlap

Post-processing function for peak detection.

Classes

AttentionModule

Attention module to apply attention mechanism on feature maps.

SCSEModule

Spatial and Channel Squeeze & Excitation (SCSE) module.

SegmentationHead

Segmentation head for UNet++ architecture.

UpSample2x

A layer to scale input by a factor of 2.