未验证 提交 a338389b 编写于 作者: W Wenyu 提交者: GitHub

fix simota candidate_topk (#6979)

上级 5e5b0bfb
...@@ -115,7 +115,10 @@ class SimOTAAssigner(object): ...@@ -115,7 +115,10 @@ class SimOTAAssigner(object):
def dynamic_k_matching(self, cost_matrix, pairwise_ious, num_gt): def dynamic_k_matching(self, cost_matrix, pairwise_ious, num_gt):
match_matrix = np.zeros_like(cost_matrix.numpy()) match_matrix = np.zeros_like(cost_matrix.numpy())
# select candidate topk ious for dynamic-k calculation # select candidate topk ious for dynamic-k calculation
topk_ious, _ = paddle.topk(pairwise_ious, self.candidate_topk, axis=0) topk_ious, _ = paddle.topk(
pairwise_ious,
min(self.candidate_topk, pairwise_ious.shape[0]),
axis=0)
# calculate dynamic k for each gt # calculate dynamic k for each gt
dynamic_ks = paddle.clip(topk_ious.sum(0).cast('int'), min=1) dynamic_ks = paddle.clip(topk_ious.sum(0).cast('int'), min=1)
for gt_idx in range(num_gt): for gt_idx in range(num_gt):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册