3D implementation of DeepLabV3

DeepLabV3+

Implementation of DeepLabV3+ for 3D. Translates the 2D version from https://github.com/giovanniguidi/deeplabV3-PyTorch to 3D. Adds the functionality to allow mulitple encoders, similar to DynamicUnet. However, works probably best with larger encoders, such as ResNet50.

ASPP

class ASPPPooling[source]

ASPPPooling(ni, nf, norm_type=None, act_cls=ReLU) :: Sequential

Pooling Layer for ASPP

class ASPP[source]

ASPP(ni, dilations, nf, norm_type=None, act_cls=ReLU, ps=0.5) :: SequentialEx

3D Atrous Spatial Pyramid Pooling
ASPP(ni=2048, dilations=[1, 6, 12, 18], nf=256, norm_type=NormType.Batch)(torch.randn(10, 2048, 1, 3, 3)).size()
torch.Size([10, 256, 1, 3, 3])
ASPP(ni=2048, dilations=[1, 12, 24, 36], nf=256, norm_type=NormType.Batch)(torch.randn(10, 2048, 1, 3, 3)).size()
torch.Size([10, 256, 1, 3, 3])

class DeepLabDecoder[source]

DeepLabDecoder(ni, low_lvl_ni, hook, n_out, norm_type=None, act_cls=ReLU, ps=0.5) :: Module

Decoder Block for DynamicDeeplab

class DynamicDeepLab[source]

DynamicDeepLab(encoder, n_out, img_size, y_range=None, act_cls=ReLU, norm_type=<NormType.Batch: 1>, **kwargs) :: SequentialEx

Build DeepLab with different encoders
from torchvision.models.video import r3d_18
body_3d = create_body(r3d_18, pretrained = False)
m = DynamicDeepLab(body_3d, 2, (20, 64, 64))
m(torch.randn(1, 3, 20, 64, 64)).shape
torch.Size([1, 2, 20, 64, 64])