# print('showPlot %s' % showPlot)

# Get groundtruth boxes
allBoundingBoxes, allClasses = getBoundingBoxes(
    gtFolder, True, gtFormat, gtCoordType, imgSize=imgSize)
# Get detected boxes
allBoundingBoxes, allClasses = getBoundingBoxes(
    detFolder, False, detFormat, detCoordType, allBoundingBoxes, allClasses, imgSize=imgSize)
allClasses.sort()

evaluator = Evaluator()
acc_AP = 0
validClasses = 0

# Plot Precision x Recall curve
# detections = evaluator.PlotPrecisionRecallCurve(
#     allBoundingBoxes,  # Object containing all bounding boxes (ground truths and detections)
#     IOUThreshold=iouThreshold,  # IOU threshold
#     method=MethodAveragePrecision.EveryPointInterpolation,
#     showAP=True,  # Show Average Precision in the title of the plot
#     showInterpolatedPrecision=False,  # Don't plot the interpolated precision curve
#     savePath=savePath,
#     showGraphic=showPlot)

# Plot only Average IOU for video, i.e., IOU per bounding box, Average IOU per image.
# average_iou = evaluator.GetIOU(allBoundingBoxes)
# avg_iou_str = "{0:.2f}%".format(average_iou * 100)
# print('Average IOU per video: %s' % avg_iou_str)
ret = evaluator.GetRelativeMetrics(allBoundingBoxes)
print(ret)