Skip to content

DeeplabV3Plus

DeeplabV3Plus class

dlf.models.deeplabl_v3_plus.DeeplabV3Plus(
    input_shape,
    num_classes,
    backbone="xception",
    OS=16,
    alpha=1.0,
    model_weights=None,
    summary=False,
    optimizer=None,
    loss=None,
    **kwargs
)

Deeplabv3+ architecture Optionally loads weights pre-trained on PASCAL VOC or Cityscapes. This model is available for TensorFlow only.

Aliases:

  • deeplab_v3_plus
  • DeeplabV3Plus

Arguments

  • input_shape: shape of input image. format HxWxC PASCAL VOC model was trained on (512,512,3) images. None is allowed as shape/width
  • num_classes: number of desired classes. PASCAL VOC has 21 classes, Cityscapes has 19 classes. If number of classes not aligned with the weights used, last layer is initialized randomly
  • backbone: backbone to use. one of {'xception','mobilenetv2'}
  • OS: determines input_shape/feature_extractor_output ratio. One of {8,16}. Used only for xception backbone.
  • alpha: controls the width of the MobileNetV2 network. This is known as the width multiplier in the MobileNetV2 paper. - If alpha < 1.0, proportionally decreases the number of filters in each layer. - If alpha > 1.0, proportionally increases the number of filters in each layer. - If alpha = 1, default number of filters from the paper are used at each layer.

    Used only for mobilenetv2 backbone. Pretrained is only available for alpha=1.

  • model_weights: str, optional. Path to the pretrained model weights. Defaults to None.

  • summary: bool, optional If true a summary of the model will be printed to stdout. Defaults to False.
  • optimizer: list of dict, optional. Name of optimizer used for training.
  • loss: list of dict, optional. List of loss objects to build for this model. Defaults to None.

Returns

A Keras model instance.

Raises

  • RuntimeError: If attempting to run this model with a backend that does not support separable convolutions.
  • ValueError: in case of invalid argument for weights or backbone

YAML Configuration

model:
    DeeplabV3Plus:
        input_shape:
            - 512
            - 512
            - 3
        num_classes: 7
        output_shape:
            - 512
            - 512
        model_weights: None
        backbone: xception
        OS: 16
        alpha: 1.0
        summary: True
        optimizer:
            - Adam:
                learning_rate: 0.0001

References