Skip to content

未找到未匹配预测实例参与PQ计算 #11

Description

@jinlong-github

我使用是提供的源代码,只发现fp_classes考虑一种情况:iou>0.5类别不匹配,剩余未匹配预测实例在何处加上?我没有找到。请给出相关的位置,谢谢!

def update(self, instances, target, lengths):
lengths = np.round( np.log(1 + lengths.cpu().numpy()) , 3)
tgt_labels = target["labels"].cpu().numpy().tolist()
tgt_masks = target["masks"].transpose(0,1).cpu().numpy()
for tgt_label, tgt_mask in zip(tgt_labels, tgt_masks):
if tgt_label==self.ignore_label: continue
flag = False
for instance in instances:
src_label = instance["labels"]
src_score = instance["scores"]
if src_label==self.ignore_label: continue
if src_score< self.min_obj_score: continue
src_mask = instance["masks"]
interArea = sum(lengths[np.logical_and(src_mask,tgt_mask)])
unionArea = sum(lengths[np.logical_or(src_mask,tgt_mask)])
iou = interArea / (unionArea + 1e-6)
if iou>=self.IoU_thres:
flag = True
if tgt_label==src_label:
self.tp_classes[tgt_label] += 1
self.tp_classes_values[tgt_label] += iou
else:
self.fp_classes[src_label] += 1
if not flag: self.fn_classes[tgt_label] += 1

Originally posted by @jinlong-github in #10

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions