otx.algo.object_detection_3d.matchers#

Matchers modules for 3d object detection.

Classes

HungarianMatcher3D([cost_class, ...])

This class computes an assignment between the targets and the predictions of the network.

class otx.algo.object_detection_3d.matchers.HungarianMatcher3D(cost_class: float = 1.0, cost_3dcenter: float = 1.0, cost_bbox: float = 1.0, cost_giou: float = 1.0)[source]#

Bases: Module

This class computes an assignment between the targets and the predictions of the network.

Creates the matcher.

Parameters:
  • cost_class (float) – This is the relative weight of the classification error in the matching cost.

  • cost_3dcenter (float) – This is the relative weight of the L1 error of the 3d center in the matching cost.

  • cost_bbox (float) – This is the relative weight of the L1 error of the bbox coordinates in the matching cost.

  • cost_giou (float) – This is the relative weight of the giou loss of the bbox in the matching cost.

forward(outputs: dict, targets: list, group_num: int = 11) list[source]#

Performs the matching.

Parameters:
  • outputs – This is a dict that contains at least these entries: “scores”: Tensor of dim [batch_size, num_queries, num_classes] with the classification logits “boxes_3d”: Tensor of dim [batch_size, num_queries, 4] with the predicted 3d box coordinates

  • targets

    This is a list of targets (len(targets) = batch_size), where each target is a dict containing: “labels”: Tensor of dim [num_target_boxes] (where num_target_boxes is the number of ground-truth

    objects in the target) containing the class labels

    ”boxes”: Tensor of dim [num_target_boxes, 4] containing the target box coordinates

Returns:

  • index_i is the indices of the selected predictions (in order)
    • index_j is the indices of the corresponding selected targets (in order)

For each batch element, it holds:

len(index_i) = len(index_j) = min(num_queries, num_target_boxes)

Return type:

A list of size batch_size, containing tuples of (index_i, index_j) where