MCPcopy Create free account
hub / github.com/FoundationVision/ByteTrack / get_loss

Method get_loss

tutorials/motr/motr.py:98–105  ·  view source on GitHub ↗
(self, loss, outputs, gt_instances, indices, num_boxes, **kwargs)

Source from the content-addressed store, hash-verified

96 return num_boxes
97
98 def get_loss(self, loss, outputs, gt_instances, indices, num_boxes, **kwargs):
99 loss_map = {
100 'labels': self.loss_labels,
101 'cardinality': self.loss_cardinality,
102 'boxes': self.loss_boxes,
103 }
104 assert loss in loss_map, f'do you really want to compute {loss} loss?'
105 return loss_map[loss](outputs, gt_instances, indices, num_boxes, **kwargs)
106
107 def loss_boxes(self, outputs, gt_instances: List[Instances], indices: List[tuple], num_boxes):
108 """Compute the losses related to the bounding boxes, the L1 regression loss and the GIoU loss

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected