|
|
|
@ -7,6 +7,8 @@ import sys, os, os.path, glob, math, cv2 |
|
|
|
|
from datetime import datetime |
|
|
|
|
import numpy |
|
|
|
|
|
|
|
|
|
plot_colors = ['b', 'r', 'g', 'c', 'm'] |
|
|
|
|
|
|
|
|
|
# "key" : ( b, g, r) |
|
|
|
|
bgr = { "red" : ( 0, 0, 255), |
|
|
|
|
"green" : ( 0, 255, 0), |
|
|
|
@ -19,7 +21,7 @@ if __name__ == "__main__": |
|
|
|
|
parser = argparse.ArgumentParser(description = 'Plot ROC curve using Caltech mathod of per image detection performance estimation.') |
|
|
|
|
|
|
|
|
|
# positional |
|
|
|
|
parser.add_argument("cascade", help = "Path to the tested detector.") |
|
|
|
|
parser.add_argument("cascade", help = "Path to the tested detector.", nargs='+') |
|
|
|
|
parser.add_argument("input", help = "Image sequence pattern.") |
|
|
|
|
parser.add_argument("annotations", help = "Path to the annotations.") |
|
|
|
|
|
|
|
|
@ -34,9 +36,13 @@ if __name__ == "__main__": |
|
|
|
|
|
|
|
|
|
args = parser.parse_args() |
|
|
|
|
|
|
|
|
|
# parse annotations |
|
|
|
|
print args.cascade |
|
|
|
|
# # parse annotations |
|
|
|
|
sft.initPlot() |
|
|
|
|
samples = call_parser(args.anttn_format, args.annotations) |
|
|
|
|
cascade = sft.cascade(args.min_scale, args.max_scale, args.nscales, args.cascade) |
|
|
|
|
for idx, each in enumerate(args.cascade): |
|
|
|
|
print each |
|
|
|
|
cascade = sft.cascade(args.min_scale, args.max_scale, args.nscales, each) |
|
|
|
|
pattern = args.input |
|
|
|
|
camera = cv2.VideoCapture(pattern) |
|
|
|
|
|
|
|
|
@ -77,4 +83,6 @@ if __name__ == "__main__": |
|
|
|
|
print nframes, nannotated |
|
|
|
|
|
|
|
|
|
fppi, miss_rate = sft.computeROC(confidenses, tp, nannotated, nframes) |
|
|
|
|
sft.plotLogLog(fppi, miss_rate) |
|
|
|
|
sft.plotLogLog(fppi, miss_rate, plot_colors[idx]) |
|
|
|
|
|
|
|
|
|
sft.showPlot("roc_curve.png") |