otx.algo.object_detection_3d.losses#
Loss functions for 3d object detection.
Classes
|
This class computes the loss for MonoDETR. |
- class otx.algo.object_detection_3d.losses.MonoDETRCriterion(num_classes: int, weight_dict: dict, focal_alpha: float, group_num: int = 11)[source]#
Bases:
Module
This class computes the loss for MonoDETR.
MonoDETRCriterion.
- Parameters:
- forward(outputs: dict[str, Tensor], targets: list[dict[str, Tensor]]) dict[str, Tensor] [source]#
This performs the loss computation.
- loss_3dcenter(outputs: dict, targets: list, indices: list, num_boxes: int) dict[str, Tensor] [source]#
Compute the loss for the 3D center prediction.
- Parameters:
outputs (dict) – dict of tensors, see the output specification of the model for the format.
targets (list) – list of dicts, such that len(targets) == batch_size. The expected keys in each dict depends on the losses applied, see each loss’ doc.
indices (list) – list of tuples, such that len(indices) == batch_size.
num_boxes (int) – number of boxes in the batch.
- loss_angles(outputs: dict, targets: list, indices: list, num_boxes: int) dict[str, Tensor] [source]#
Compute the loss for the angle prediction.
- Parameters:
outputs (dict) – dict of tensors, see the output specification of the model for the format.
targets (list) – list of dicts, such that len(targets) == batch_size. The expected keys in each dict depends on the losses applied, see each loss’ doc.
indices (list) – list of tuples, such that len(indices) == batch_size.
num_boxes (int) – number of boxes in the batch.
- loss_boxes(outputs: dict, targets: list, indices: list, num_boxes: int) dict[str, Tensor] [source]#
Compute l1 loss.
- Parameters:
outputs (dict) – dict of tensors, see the output specification of the model for the format.
targets (list) – list of dicts, such that len(targets) == batch_size. The expected keys in each dict depends on the losses applied, see each loss’ doc.
indices (list) – list of tuples, such that len(indices) == batch_size.
num_boxes (int) – number of boxes in the batch.
- loss_depth_map(outputs: dict, targets: list, indices: list, num_boxes: int) dict[str, Tensor] [source]#
Depth map loss.
- Parameters:
outputs (dict) – dict of tensors, see the output specification of the model for the format.
targets (list) – list of dicts, such that len(targets) == batch_size. The expected keys in each dict depends on the losses applied, see each loss’ doc.
indices (list) – list of tuples, such that len(indices) == batch_size.
num_boxes (int) – number of boxes in the batch.
- loss_depths(outputs: dict, targets: list, indices: list, num_boxes: int) dict[str, Tensor] [source]#
Compute the loss for the depth prediction.
- Parameters:
outputs (dict) – dict of tensors, see the output specification of the model for the format.
targets (list) – list of dicts, such that len(targets) == batch_size. The expected keys in each dict depends on the losses applied, see each loss’ doc.
indices (list) – list of tuples, such that len(indices) == batch_size.
num_boxes (int) – number of boxes in the batch
- loss_dims(outputs: dict, targets: list, indices: list, num_boxes: int) dict[str, Tensor] [source]#
Compute the loss for the dimension prediction.
- Parameters:
outputs (dict) – dict of tensors, see the output specification of the model for the format.
targets (list) – list of dicts, such that len(targets) == batch_size. The expected keys in each dict depends on the losses applied, see each loss’ doc.
indices (list) – list of tuples, such that len(indices) == batch_size.
num_boxes (int) – number of boxes in the batch.
- loss_giou(outputs: dict, targets: list, indices: list, num_boxes: int) dict[str, Tensor] [source]#
Compute the GIoU loss.
- Parameters:
outputs (dict) – dict of tensors, see the output specification of the model for the format.
targets (list) – list of dicts, such that len(targets) == batch_size. The expected keys in each dict depends on the losses applied, see each loss’ doc.
indices (list) – list of tuples, such that len(indices) == batch_size.
num_boxes (int) – number of boxes in the batch.
- loss_labels(outputs: dict, targets: list, indices: list, num_boxes: int) dict[str, Tensor] [source]#
Classification loss.
- Parameters:
outputs (dict) – dict of tensors, see the output specification of the model for the format.
targets (list) – list of dicts, such that len(targets) == batch_size. The expected keys in each dict depends on the losses applied, see each loss’ doc.
indices (list) – list of tuples, such that len(indices) == batch_size.
num_boxes (int) – number of boxes in the batch.