This commit is contained in:
Glenn Jocher 2018-11-22 16:42:58 +01:00
parent 06579775a3
commit 57f2b3f6d7
2 changed files with 4 additions and 3 deletions

View File

@ -126,12 +126,13 @@ def main(opt):
print(('%11s%11s' + '%11.3g' * 3) % (len(mAPs), len(dataloader) * opt.batch_size, mean_P, mean_R, mean_mAP)) print(('%11s%11s' + '%11.3g' * 3) % (len(mAPs), len(dataloader) * opt.batch_size, mean_P, mean_R, mean_mAP))
# Print mAP per class # Print mAP per class
print('%11s' * 5 % ('Image', 'Total', 'P', 'R', 'mAP') + '\n\nmAP Per Class:')
classes = load_classes(opt.class_path) # Extracts class labels from file classes = load_classes(opt.class_path) # Extracts class labels from file
for i, c in enumerate(classes): for i, c in enumerate(classes):
print('%15s: %-.4f' % (c, AP_accum[i] / AP_accum_count[i])) print('%15s: %-.4f' % (c, AP_accum[i] / AP_accum_count[i]))
# Print mAP # Return mAP
print('%11s' * 5 % ('Image', 'Total', 'P', 'R', 'mAP'))
return mean_mAP, mean_R, mean_P return mean_mAP, mean_R, mean_P

View File

@ -300,7 +300,7 @@ def non_max_suppression(prediction, conf_thres=0.5, nms_thres=0.4):
# Filter out confidence scores below threshold # Filter out confidence scores below threshold
# Get score and class with highest confidence # Get score and class with highest confidence
# cross-class NMS # cross-class NMS (experimental)
cross_class_nms = False cross_class_nms = False
if cross_class_nms: if cross_class_nms:
# thresh = 0.85 # thresh = 0.85