-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c00afe9
commit aeb7217
Showing
2 changed files
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ | |
# # | ||
# This sample demonstrates: # | ||
# * How to create your own bounding boxes (detections and ground truth) manually; # | ||
# * Fill the object of the class BoundingBoxes with your bounding boxes; # | ||
# * Ground truth bounding boxes are drawn in green and detected boxes are drawn in red; # | ||
# * Create objects of the class BoundingBoxes with your bounding boxes; # | ||
# * Create images with detections and ground truth; # | ||
# # | ||
# Developed by: Rafael Padilla ([email protected]) # | ||
|
@@ -11,12 +12,13 @@ | |
# Last modification: May 24th 2018 # | ||
########################################################################################### | ||
|
||
import os | ||
|
||
import _init_paths | ||
import cv2 | ||
import os | ||
from utils import * | ||
from BoundingBox import BoundingBox | ||
from BoundingBoxes import BoundingBoxes | ||
from utils import * | ||
|
||
########################### | ||
# Defining bounding boxes # | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
########################################################################################### | ||
# # | ||
# This sample shows how to evaluate object detections applying the following metrics: # | ||
# * Precision x Recall curve ----> used by VOC PASCAL 2012) # | ||
# * Average Precision (AP) ----> used by VOC PASCAL 2012) # | ||
# * Precision x Recall curve ----> used by VOC PASCAL 2012 # | ||
# * Average Precision (AP) ----> used by VOC PASCAL 2012 # | ||
# # | ||
# Developed by: Rafael Padilla ([email protected]) # | ||
# SMT - Signal Multimedia and Telecommunications Lab # | ||
|
@@ -136,12 +136,11 @@ def createImages(dictGroundTruth, dictDetected): | |
############################################################## | ||
# Plot Precision x Recall curve | ||
evaluator.PlotPrecisionRecallCurve( | ||
'object', # Class to show | ||
boundingboxes, # Object containing all bounding boxes (ground truths and detections) | ||
IOUThreshold=0.3, # IOU threshold | ||
method=MethodAveragePrecision.EveryPointInterpolation, # As the official matlab code | ||
showAP=True, # Show Average Precision in the title of the plot | ||
showInterpolatedPrecision=True) # Don't plot the interpolated precision curve | ||
showInterpolatedPrecision=True) # Plot the interpolated precision curve | ||
# Get metrics with PASCAL VOC metrics | ||
metricsPerClass = evaluator.GetPascalVOCMetrics( | ||
boundingboxes, # Object containing all bounding boxes (ground truths and detections) | ||
|