bob.ip.binseg.models.driu_bn

Functions

driu_bn([pretrained_backbone, progress])

Builds DRIU with batch-normalization by adding backbone and head together

Classes

ConcatFuseBlock()

Takes in four feature maps with 16 channels each, concatenates them and applies a 1x1 convolution with 1 output channel.

DRIUBN([in_channels_list])

DRIU with Batch-Normalization head module

class bob.ip.binseg.models.driu_bn.ConcatFuseBlock[source]

Bases: Module

Takes in four feature maps with 16 channels each, concatenates them and applies a 1x1 convolution with 1 output channel.

forward(x1, x2, x3, x4)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class bob.ip.binseg.models.driu_bn.DRIUBN(in_channels_list=None)[source]

Bases: Module

DRIU with Batch-Normalization head module

Based on paper by [MANINIS-2016].

Parameters

in_channels_list (list) – number of channels for each feature map that is returned from backbone

forward(x)[source]
Parameters

x (list) – list of tensors as returned from the backbone network. First element: height and width of input image. Remaining elements: feature maps for each feature level.

Return type

torch.Tensor

bob.ip.binseg.models.driu_bn.driu_bn(pretrained_backbone=True, progress=True)[source]

Builds DRIU with batch-normalization by adding backbone and head together

Parameters
  • pretrained_backbone (bool, Optional) – If set to True, then loads a pre-trained version of the backbone (not the head) for the DRIU network using VGG-16 trained for ImageNet classification.

  • progress (bool, Optional) – If set to True, and you decided to use a pretrained_backbone, then, shows a progress bar of the backbone model downloading if download is necesssary.

Returns

module – Network model for DRIU (vessel segmentation) using batch normalization

Return type

torch.nn.Module