Skip to content

Detection

Models for 2D object detection

[source]

SSD300

paz.models.detection.ssd300.SSD300(num_classes=21, base_weights='VOC', head_weights='VOC', input_shape=(300, 300, 3), num_priors=[4, 6, 6, 6, 4, 4], l2_loss=0.0005, return_base=False, trainable_base=True)

Single-shot-multibox detector for 300x300x3 BGR input images. Arguments

  • num_classes: Integer. Specifies the number of class labels.
  • base_weights: String or None. If string should be a valid dataset name. Current valid datasets include VOC FAT and VGG.
  • head_weights: String or None. If string should be a valid dataset name. Current valid datasets include VOC and FAT.
  • input_shape: List of integers. Input shape to the model including only spatial and channel resolution e.g. (300, 300, 3).
  • num_priors: List of integers. Number of default box shapes used in each detection layer.
  • l2_loss: Float. l2 regularization loss for convolutional layers.
  • return_base: Boolean. If True the model returned is just the original base.
  • trainable_base: Boolean. If True the base model weights are also trained.

Reference


[source]

SSD512

paz.models.detection.ssd512.SSD512(num_classes=81, base_weights='COCO', head_weights='COCO', input_shape=(512, 512, 3), num_priors=[4, 6, 6, 6, 6, 4, 4], l2_loss=0.0005, return_base=False, trainable_base=True)

Single-shot-multibox detector for 512x512x3 BGR input images. Arguments

  • num_classes: Integer. Specifies the number of class labels.
  • base_weights: String or None. If string should be a valid dataset name. Current valid datasets include COCO and OIV6Hand.
  • head_weights: String or None. If string should be a valid dataset name. Current valid datasets include COCO, YCBVideo and OIV6Hand.
  • input_shape: List of integers. Input shape to the model including only spatial and channel resolution e.g. (512, 512, 3).
  • num_priors: List of integers. Number of default box shapes used in each detection layer.
  • l2_loss: Float. l2 regularization loss for convolutional layers.
  • return_base: Boolean. If True the model returned is just the original base.
  • trainable_base: Boolean. If True the base model weights are also trained.

Reference


[source]

HaarCascadeDetector

paz.models.detection.haar_cascade.HaarCascadeDetector(self, weights='frontalface_default', class_arg=None, scale=1.3, neighbors=5)

Haar cascade face detector.

Arguments

  • path: String. Postfix to default openCV haarcascades XML files, see [1] e.g. eye, frontalface_alt2, fullbody
  • class_arg: Int. Class label argument.

scale = Float. Scale for image reduction

  • neighbors: Int. Minimum neighbors

Reference


[source]

EFFICIENTDETD0

paz.models.detection.efficientdet.efficientdet.EFFICIENTDETD0(num_classes=90, base_weights='COCO', head_weights='COCO', input_shape=(512, 512, 3), FPN_num_filters=64, FPN_cell_repeats=3, box_class_repeats=3, anchor_scale=4.0, fusion='fast', return_base=False, model_name='efficientdet-d0', scaling_coefficients=(1.0, 1.0, 0.8))

Instantiates EfficientDet-D0 model.

Arguments

  • num_classes: Int, number of object classes.
  • base_weights: Str, base weights name.
  • head_weights: Str, head weights name.
  • input_shape: Tuple, holding input image size.
  • FPN_num_filters: Int, number of FPN filters.
  • FPN_cell_repeats: Int, number of FPN blocks.
  • box_class_repeats: Int, Number of regression and classification blocks.
  • anchor_scale: Int, number of anchor scales.
  • fusion: Str, feature fusion weighting method.
  • return_base: Bool, whether to return base or not.
  • model_name: Str, EfficientDet model name.
  • scaling_coefficients: Tuple, EfficientNet scaling coefficients.

Returns

  • model: EfficientDet-D0 model.

[source]

EFFICIENTDETD1

paz.models.detection.efficientdet.efficientdet.EFFICIENTDETD1(num_classes=90, base_weights='COCO', head_weights='COCO', input_shape=(640, 640, 3), FPN_num_filters=88, FPN_cell_repeats=4, box_class_repeats=3, anchor_scale=4.0, fusion='fast', return_base=False, model_name='efficientdet-d1', scaling_coefficients=(1.0, 1.1, 0.8))

Instantiates EfficientDet-D1 model.

Arguments

  • num_classes: Int, number of object classes.
  • base_weights: Str, base weights name.
  • head_weights: Str, head weights name.
  • input_shape: Tuple, holding input image size.
  • FPN_num_filters: Int, number of FPN filters.
  • FPN_cell_repeats: Int, number of FPN blocks.
  • box_class_repeats: Int, Number of regression and classification blocks.
  • anchor_scale: Int, number of anchor scales.
  • fusion: Str, feature fusion weighting method.
  • return_base: Bool, whether to return base or not.
  • model_name: Str, EfficientDet model name.
  • scaling_coefficients: Tuple, EfficientNet scaling coefficients.

Returns

  • model: EfficientDet-D1 model.

[source]

EFFICIENTDETD2

paz.models.detection.efficientdet.efficientdet.EFFICIENTDETD2(num_classes=90, base_weights='COCO', head_weights='COCO', input_shape=(768, 768, 3), FPN_num_filters=112, FPN_cell_repeats=5, box_class_repeats=3, anchor_scale=4.0, fusion='fast', return_base=False, model_name='efficientdet-d2', scaling_coefficients=(1.1, 1.2, 0.7))

Instantiate EfficientDet-D2 model.

Arguments

  • num_classes: Int, number of object classes.
  • base_weights: Str, base weights name.
  • head_weights: Str, head weights name.
  • input_shape: Tuple, holding input image size.
  • FPN_num_filters: Int, number of FPN filters.
  • FPN_cell_repeats: Int, number of FPN blocks.
  • box_class_repeats: Int, Number of regression and classification blocks.
  • anchor_scale: Int, number of anchor scales.
  • fusion: Str, feature fusion weighting method.
  • return_base: Bool, whether to return base or not.
  • model_name: Str, EfficientDet model name.
  • scaling_coefficients: Tuple, EfficientNet scaling coefficients.

Returns

  • model: EfficientDet-D2 model.

[source]

EFFICIENTDETD3

paz.models.detection.efficientdet.efficientdet.EFFICIENTDETD3(num_classes=90, base_weights='COCO', head_weights='COCO', input_shape=(896, 896, 3), FPN_num_filters=160, FPN_cell_repeats=6, box_class_repeats=4, anchor_scale=4.0, fusion='fast', return_base=False, model_name='efficientdet-d3', scaling_coefficients=(1.2, 1.4, 0.7))

Instantiates EfficientDet-D3 model.

Arguments

  • num_classes: Int, number of object classes.
  • base_weights: Str, base weights name.
  • head_weights: Str, head weights name.
  • input_shape: Tuple, holding input image size.
  • FPN_num_filters: Int, number of FPN filters.
  • FPN_cell_repeats: Int, number of FPN blocks.
  • box_class_repeats: Int, Number of regression and classification blocks.
  • anchor_scale: Int, number of anchor scales.
  • fusion: Str, feature fusion weighting method.
  • return_base: Bool, whether to return base or not.
  • model_name: Str, EfficientDet model name.
  • scaling_coefficients: Tuple, EfficientNet scaling coefficients.

Returns

  • model: EfficientDet-D3 model.

[source]

EFFICIENTDETD4

paz.models.detection.efficientdet.efficientdet.EFFICIENTDETD4(num_classes=90, base_weights='COCO', head_weights='COCO', input_shape=(1024, 1024, 3), FPN_num_filters=224, FPN_cell_repeats=7, box_class_repeats=4, anchor_scale=4.0, fusion='fast', return_base=False, model_name='efficientdet-d4', scaling_coefficients=(1.4, 1.8, 0.6))

Instantiates EfficientDet-D4 model.

Arguments

  • num_classes: Int, number of object classes.
  • base_weights: Str, base weights name.
  • head_weights: Str, head weights name.
  • input_shape: Tuple, holding input image size.
  • FPN_num_filters: Int, number of FPN filters.
  • FPN_cell_repeats: Int, number of FPN blocks.
  • box_class_repeats: Int, Number of regression and classification blocks.
  • anchor_scale: Int, number of anchor scales.
  • fusion: Str, feature fusion weighting method.
  • return_base: Bool, whether to return base or not.
  • model_name: Str, EfficientDet model name.
  • scaling_coefficients: Tuple, EfficientNet scaling coefficients.

Returns

  • model: EfficientDet-D4 model.

[source]

EFFICIENTDETD5

paz.models.detection.efficientdet.efficientdet.EFFICIENTDETD5(num_classes=90, base_weights='COCO', head_weights='COCO', input_shape=(1280, 1280, 3), FPN_num_filters=288, FPN_cell_repeats=7, box_class_repeats=4, anchor_scale=4.0, fusion='fast', return_base=False, model_name='efficientdet-d5', scaling_coefficients=(1.6, 2.2, 0.6))

Instantiates EfficientDet-D5 model.

Arguments

  • num_classes: Int, number of object classes.
  • base_weights: Str, base weights name.
  • head_weights: Str, head weights name.
  • input_shape: Tuple, holding input image size.
  • FPN_num_filters: Int, number of FPN filters.
  • FPN_cell_repeats: Int, number of FPN blocks.
  • box_class_repeats: Int, Number of regression and classification blocks.
  • anchor_scale: Int, number of anchor scales.
  • fusion: Str, feature fusion weighting method.
  • return_base: Bool, whether to return base or not.
  • model_name: Str, EfficientDet model name.
  • scaling_coefficients: Tuple, EfficientNet scaling coefficients.

Returns

  • model: EfficientDet-D5 model.

[source]

EFFICIENTDETD6

paz.models.detection.efficientdet.efficientdet.EFFICIENTDETD6(num_classes=90, base_weights='COCO', head_weights='COCO', input_shape=(1280, 1280, 3), FPN_num_filters=384, FPN_cell_repeats=8, box_class_repeats=5, anchor_scale=5.0, fusion='sum', return_base=False, model_name='efficientdet-d6', scaling_coefficients=(1.8, 2.6, 0.5))

Instantiates EfficientDet-D6 model.

Arguments

  • num_classes: Int, number of object classes.
  • base_weights: Str, base weights name.
  • head_weights: Str, head weights name.
  • input_shape: Tuple, holding input image size.
  • FPN_num_filters: Int, number of FPN filters.
  • FPN_cell_repeats: Int, number of FPN blocks.
  • box_class_repeats: Int, Number of regression and classification blocks.
  • anchor_scale: Int, number of anchor scales.
  • fusion: Str, feature fusion weighting method.
  • return_base: Bool, whether to return base or not.
  • model_name: Str, EfficientDet model name.
  • scaling_coefficients: Tuple, EfficientNet scaling coefficients.

Returns

  • model: EfficientDet-D6 model.

[source]

EFFICIENTDETD7

paz.models.detection.efficientdet.efficientdet.EFFICIENTDETD7(num_classes=90, base_weights='COCO', head_weights='COCO', input_shape=(1536, 1536, 3), FPN_num_filters=384, FPN_cell_repeats=8, box_class_repeats=5, anchor_scale=5.0, fusion='sum', return_base=False, model_name='efficientdet-d7', scaling_coefficients=(1.8, 2.6, 0.5))

Instantiates EfficientDet-D7 model.

Arguments

  • num_classes: Int, number of object classes.
  • base_weights: Str, base weights name.
  • head_weights: Str, head weights name.
  • input_shape: Tuple, holding input image size.
  • FPN_num_filters: Int, number of FPN filters.
  • FPN_cell_repeats: Int, number of FPN blocks.
  • box_class_repeats: Int, Number of regression and classification blocks.
  • anchor_scale: Int, number of anchor scales.
  • fusion: Str, feature fusion weighting method.
  • return_base: Bool, whether to return base or not.
  • model_name: Str, EfficientDet model name.
  • scaling_coefficients: Tuple, EfficientNet scaling coefficients.

Returns

  • model: EfficientDet-D7 model.