MCPcopy Create free account
hub / github.com/InternRobotics/EmbodiedScan / IoU3DCost

Class IoU3DCost

embodiedscan/models/losses/match_cost.py:96–113  ·  view source on GitHub ↗

3D IoU cost for 3D boxes.

Source from the content-addressed store, hash-verified

94
95@TASK_UTILS.register_module()
96class IoU3DCost(object):
97 """3D IoU cost for 3D boxes."""
98
99 def __init__(self, weight):
100 self.weight = weight
101
102 def __call__(self, pred_instances: InstanceData,
103 gt_instances: InstanceData):
104 pred_bboxes = EulerDepthInstance3DBoxes(
105 pred_instances.bboxes_3d.tensor, origin=(0.5, 0.5, 0.5))
106 gt_bboxes = EulerDepthInstance3DBoxes(gt_instances.bboxes_3d.tensor,
107 origin=(0.5, 0.5, 0.5))
108 overlaps = pred_bboxes.overlaps(pred_bboxes, gt_bboxes)
109
110 # The 1 is a constant that doesn't change the matching, so omitted.
111 iou_cost = -overlaps
112
113 return iou_cost * self.weight
114
115
116@TASK_UTILS.register_module()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected