updates
This commit is contained in:
parent
84ebb5d143
commit
e1850bf234
7
test.py
7
test.py
|
@ -128,12 +128,13 @@ def test(
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Best iou, index between pred and targets
|
# Best iou, index between pred and targets
|
||||||
iou, bi = bbox_iou(pbox, tbox).max(0)
|
m = (pcls == tcls_tensor).nonzero().view(-1)
|
||||||
|
iou, bi = bbox_iou(pbox, tbox[m]).max(0)
|
||||||
|
|
||||||
# If iou > threshold and class is correct mark as correct
|
# If iou > threshold and class is correct mark as correct
|
||||||
if iou > iou_thres and bi not in detected: # and pcls == tcls[bi]:
|
if iou > iou_thres and m[bi] not in detected: # and pcls == tcls[bi]:
|
||||||
correct[i] = 1
|
correct[i] = 1
|
||||||
detected.append(bi)
|
detected.append(m[bi])
|
||||||
|
|
||||||
# Append statistics (correct, conf, pcls, tcls)
|
# Append statistics (correct, conf, pcls, tcls)
|
||||||
stats.append((correct, pred[:, 4].cpu(), pred[:, 6].cpu(), tcls))
|
stats.append((correct, pred[:, 4].cpu(), pred[:, 6].cpu(), tcls))
|
||||||
|
|
Loading…
Reference in New Issue