vis4d.op.box.matchers.sim_ota¶
SimOTA label assigner.
Modified from mmdetection (https://github.com/open-mmlab/mmdetection).
Classes
|
SimOTA label assigner used by YOLOX. |
- class SimOTAMatcher(center_radius=2.5, candidate_topk=10, iou_weight=3.0, cls_weight=1.0)[source]¶
SimOTA label assigner used by YOLOX.
- Parameters:
center_radius (float, optional) – Ground truth center size to judge whether a prior is in center. Defaults to 2.5.
candidate_topk (int, optional) – The candidate top-k which used to get top-k ious to calculate dynamic-k. Defaults to 10.
iou_weight (float, optional) – The scale factor for regression iou cost. Defaults to 3.0.
cls_weight (float, optional) – The scale factor for classification cost. Defaults to 1.0.
Init.
- __call__(pred_scores, priors, decoded_bboxes, gt_bboxes, gt_labels)[source]¶
Type declaration for forward.
- Return type:
- dynamic_k_matching(cost, pairwise_ious, num_gt, valid_mask)[source]¶
Dynamic K matching strategy.
- Return type:
tuple
[Tensor
,Tensor
]
- forward(pred_scores, priors, decoded_bboxes, gt_bboxes, gt_labels)[source]¶
Assign gt to priors using SimOTA.
- Parameters:
pred_scores (Tensor) – Classification scores of one image, a 2D-Tensor with shape [num_priors, num_classes]
priors (Tensor) – All priors of one image, a 2D-Tensor with shape [num_priors, 4] in [cx, xy, stride_w, stride_y] format.
decoded_bboxes (Tensor) – Predicted bboxes, a 2D-Tensor with shape [num_priors, 4] in [tl_x, tl_y, br_x, br_y] format.
gt_bboxes (Tensor) – Ground truth bboxes of one image, a 2D-Tensor with shape [num_gts, 4] in [tl_x, tl_y, br_x, br_y] format.
gt_labels (Tensor) – Ground truth labels of one image, a Tensor with shape [num_gts].
- Returns:
The assigned result.
- Return type: