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

Class BaseMatchCost

embodiedscan/models/losses/match_cost.py:12–46  ·  view source on GitHub ↗

Base match cost class. Args: weight (Union[float, int]): Cost weight. Defaults to 1.

Source from the content-addressed store, hash-verified

10
11
12class BaseMatchCost:
13 """Base match cost class.
14
15 Args:
16 weight (Union[float, int]): Cost weight. Defaults to 1.
17 """
18
19 def __init__(self, weight: Union[float, int] = 1.) -> None:
20 self.weight = weight
21
22 @abstractmethod
23 def __call__(self,
24 pred_instances: InstanceData,
25 gt_instances: InstanceData,
26 img_meta: Optional[dict] = None,
27 **kwargs) -> Tensor:
28 """Compute match cost.
29
30 Args:
31 pred_instances (:obj:`InstanceData`): Instances of model
32 predictions. It includes ``priors``, and the priors can
33 be anchors or points, or the bboxes predicted by the
34 previous stage, has shape (n, 4). The bboxes predicted by
35 the current model or stage will be named ``bboxes``,
36 ``labels``, and ``scores``, the same as the ``InstanceData``
37 in other places.
38 gt_instances (:obj:`InstanceData`): Ground truth of instance
39 annotations. It usually includes ``bboxes``, with shape (k, 4),
40 and ``labels``, with shape (k, ).
41 img_meta (dict, optional): Image information.
42
43 Returns:
44 Tensor: Match Cost matrix of shape (num_preds, num_gts).
45 """
46 pass
47
48
49@TASK_UTILS.register_module()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected