-
Notifications
You must be signed in to change notification settings - Fork 6
Description
我使用是提供的源代码,只发现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