Skip to content

Detection

Processors for object detection

[source]

SquareBoxes2D

paz.processors.detection.SquareBoxes2D()

Transforms bounding rectangular boxes into square bounding boxes.


[source]

DenormalizeBoxes2D

paz.processors.detection.DenormalizeBoxes2D()

Denormalizes boxes shapes to be in accordance to the original image size.

Arguments:

  • image_size: List containing height and width of an image.

[source]

RoundBoxes2D

paz.processors.detection.RoundBoxes2D()

Round to integer box coordinates.


[source]

ClipBoxes2D

paz.processors.detection.ClipBoxes2D()

Clips boxes coordinates into the image dimensions

[source]

FilterClassBoxes2D

paz.processors.detection.FilterClassBoxes2D(valid_class_names)

Filters boxes with valid class names.

Arguments

  • valid_class_names: List of strings indicating class names to be kept.

[source]

CropBoxes2D

paz.processors.detection.CropBoxes2D()

Creates a list of images cropped from the bounding boxes.

Arguments

  • offset_scales: List of floats having x and y scales respectively.

[source]

ToBoxes2D

paz.processors.detection.ToBoxes2D(class_names=None, one_hot_encoded=False, default_score=1.0, default_class=None, box_method=0)

Transforms boxes from dataset into Boxes2D messages.

Arguments

  • class_names: List of class names ordered with respect to the class indices from the dataset boxes.
  • one_hot_encoded: Bool, indicating if scores are one hot vectors.
  • default_score: Float, score to set.
  • default_class: Str, class to set.
  • box_method: Int, method to convert boxes to Boxes2D.

Properties

  • one_hot_encoded: Bool.
  • box_processor: Callable.

Methods

call()


[source]

MatchBoxes

paz.processors.detection.MatchBoxes(prior_boxes, iou=0.5)

Match prior boxes with ground truth boxes.

Arguments

  • prior_boxes: Numpy array of shape (num_boxes, 4).
  • iou: Float in [0, 1]. Intersection over union in which prior boxes will be considered positive. A positive box is box with a class different than background.
  • variance: List of two floats.

[source]

EncodeBoxes

paz.processors.detection.EncodeBoxes(prior_boxes, variances=[0.1, 0.1, 0.2, 0.2])

Encodes bounding boxes.

Arguments

  • prior_boxes: Numpy array of shape (num_boxes, 4).
  • variances: List of two float values.

[source]

DecodeBoxes

paz.processors.detection.DecodeBoxes(prior_boxes, variances=[0.1, 0.1, 0.2, 0.2])

Decodes bounding boxes.

Arguments

  • prior_boxes: Numpy array of shape (num_boxes, 4).
  • variances: List of two float values.

[source]

NonMaximumSuppressionPerClass

paz.processors.detection.NonMaximumSuppressionPerClass(nms_thresh=0.45, epsilon=0.01)

Applies non maximum suppression per class.

Arguments

  • nms_thresh: Float between [0, 1].
  • epsilon: Float between [0, 1].

[source]

MergeNMSBoxWithClass

paz.processors.detection.MergeNMSBoxWithClass()

Merges box coordinates with their corresponding class defined by class_labels which is decided by best box geometry by non maximum suppression (and not by the best scoring class) into a single output.


[source]

FilterBoxes

paz.processors.detection.FilterBoxes(class_names, conf_thresh=0.5)

Filters boxes outputted from function detect as Box2D messages.

Arguments

  • class_names: List of class names.
  • conf_thresh: Float between [0, 1].

[source]

OffsetBoxes2D

paz.processors.detection.OffsetBoxes2D(offsets)

Offsets the height and widht of a list of Boxes2D.

Arguments

  • offsets: Float between [0, 1].

[source]

CropImage

paz.processors.detection.CropImage()

Crop images using a list of box2D.


[source]

BoxesToBoxes2D

paz.processors.detection.BoxesToBoxes2D(default_score=1.0, default_class=None)

Transforms boxes from dataset into Boxes2D messages given no class names and score.

Arguments

  • default_score: Float, score to set.
  • default_class: Str, class to set.

Properties

  • default_score: Float.
  • default_class: Str.

Methods

call()


[source]

BoxesWithOneHotVectorsToBoxes2D

paz.processors.detection.BoxesWithOneHotVectorsToBoxes2D(arg_to_class)

Transforms boxes from dataset into Boxes2D messages given boxes with scores as one hot vectors.

Arguments

  • arg_to_class: List, of classes.

Properties

  • arg_to_class: List.

Methods

call()


[source]

BoxesWithClassArgToBoxes2D

paz.processors.detection.BoxesWithClassArgToBoxes2D(arg_to_class, default_score=1.0)

Transforms boxes from dataset into Boxes2D messages given boxes with class argument.

Arguments

  • default_score: Float, score to set.
  • arg_to_class: List, of classes.

Properties

  • default_score: Float.
  • arg_to_class: List.

Methods

call()


[source]

RoundBoxes

paz.processors.detection.RoundBoxes()

Rounds the floating value coordinates of the box coordinates into integer type.

Methods

call()


[source]

RemoveClass

paz.processors.detection.RemoveClass(class_names, class_arg=None, renormalize=False)

Remove a particular class from the pipeline.

Arguments

  • class_names: List, indicating given class names.
  • class_arg: Int, index of the class to be removed.
  • renormalize: Bool, if true scores are renormalized.

Properties

  • class_arg: Int.
  • renormalize: Bool

Methods

call()


[source]

ScaleBox

paz.processors.detection.ScaleBox()

Scale box coordinates of the prediction.

Arguments

  • scales: Array of shape (), value to scale boxes.

Properties

  • scales: Int.

Methods

call()


[source]

AddClassAndScoreToBoxes

paz.processors.detection.AddClassAndScoreToBoxes(classifier)

Adds class name and score to boxes.

Arguments

  • classifier: Keras model.