P and R conf thresh to 0.5

This commit is contained in:
Glenn Jocher 2018-10-05 16:01:27 +02:00
parent bce94f6ade
commit 8a87521044
2 changed files with 4 additions and 4 deletions

View File

@ -182,7 +182,7 @@ class YOLOLayer(nn.Module):
loss = lx + ly + lw + lh + lconf + lcls
# Sum False Positives from unassigned anchors
i = torch.sigmoid(pred_conf[~mask]) > 0.9
i = torch.sigmoid(pred_conf[~mask]) > 0.5
if i.sum() > 0:
FP_classes = torch.argmax(pred_cls[~mask][i], 1)
FPe = torch.bincount(FP_classes, minlength=self.nC).float().cpu() # extra FPs

View File

@ -282,9 +282,9 @@ def build_targets(pred_boxes, pred_conf, pred_cls, target, anchor_wh, nA, nC, nG
pconf = torch.sigmoid(pred_conf[b, a, gj, gi]).cpu()
iou_pred = bbox_iou(tb, pred_boxes[b, a, gj, gi].cpu())
TP[b, i] = (pconf > 0.9) & (iou_pred > 0.5) & (pcls == tc)
FP[b, i] = (pconf > 0.9) & (TP[b, i] == 0) # coordinates or class are wrong
FN[b, i] = pconf <= 0.9 # confidence score is too low (set to zero)
TP[b, i] = (pconf > 0.5) & (iou_pred > 0.5) & (pcls == tc)
FP[b, i] = (pconf > 0.5) & (TP[b, i] == 0) # coordinates or class are wrong
FN[b, i] = pconf <= 0.5 # confidence score is too low (set to zero)
return tx, ty, tw, th, tconf, tcls, TP, FP, FN, TC