bob.ip.binseg.models.m2unet¶
Functions
|
Builds M2U-Net for segmentation by adding backbone and head together |
Classes
|
Decoder block: upsample and concatenate with features maps from the encoder part |
|
|
|
M2U-Net head module |
-
class
bob.ip.binseg.models.m2unet.
DecoderBlock
(up_in_c, x_in_c, upsamplemode='bilinear', expand_ratio=0.15)[source]¶ Bases:
torch.nn.modules.module.Module
Decoder block: upsample and concatenate with features maps from the encoder part
-
forward
(up_in, x_in)[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.m2unet.
LastDecoderBlock
(x_in_c, upsamplemode='bilinear', expand_ratio=0.15)[source]¶ Bases:
torch.nn.modules.module.Module
-
forward
(up_in, x_in)[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.m2unet.
M2UNet
(in_channels_list=None, upsamplemode='bilinear', expand_ratio=0.15)[source]¶ Bases:
torch.nn.modules.module.Module
M2U-Net head module
- Parameters
in_channels_list (list) – number of channels for each feature map that is returned from backbone
-
bob.ip.binseg.models.m2unet.
m2unet
(pretrained_backbone=True, progress=True)[source]¶ Builds M2U-Net for segmentation by adding backbone and head together
- Parameters
pretrained_backbone (
bool
, Optional) – If set toTrue
, 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 toTrue
, and you decided to use apretrained_backbone
, then, shows a progress bar of the backbone model downloading if download is necesssary.
- Returns
module – Network model for M2U-Net (segmentation)
- Return type