biapy.models.resunet_plus_plus

Legacy wrapper for ResUNet++ model to maintain backward compatibility.

This module provides access to the original ResUNet++ implementation from resunet++.py while providing a Python-importable module name (resunet_plus_plus.py).

class biapy.models.resunet_plus_plus.ResUNetPlusPlus(*args, **kwargs)[source]

Bases: ResUNetPlusPlus

Implementation of the ResUNet++ architecture for 2D and 3D image segmentation.

This model integrates residual blocks, SE blocks, attention mechanisms, and ASPP modules into a U-Net-like encoder-decoder architecture, enhancing performance on complex biomedical images.

forward(x) Dict | Tensor[source]

Forward pass of the model.

Parameters:

x (torch.Tensor) – Input tensor of shape (batch_size, channels, height, width) for 2D or (batch_size, channels, depth, height, width) for 3D.

Returns:

Model output. Returns a dictionary if multi-head or contrastive outputs are enabled, otherwise returns the main prediction tensor.

Return type:

Dict or torch.Tensor