From bd120ec757d0a8905e6a9bd2ebe8ebbf9d0c124d Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Thu, 16 Feb 2012 20:01:38 -0800 Subject: Plot of accuracy as a function of the distance. Will finish this at home. --- data/face-detection-accuracy.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 data/face-detection-accuracy.py diff --git a/data/face-detection-accuracy.py b/data/face-detection-accuracy.py new file mode 100755 index 0000000..ad43a2f --- /dev/null +++ b/data/face-detection-accuracy.py @@ -0,0 +1,16 @@ +#!/usr/bin/python +import matplotlib.pyplot as plt +import matplotlib.mlab as ml +import numpy as np +import sys + +face_filename = sys.argv[1] +data = ml.load(face_filename,delimiter=",",usecols=[3,4]) +distance_detected = [float(distance) for (distance,detected) in data if int(detected)>0] +distance = [float(distance) for (distance,detected) in data] +range = (min(distance),max(distance)) +hist_detected,bins = np.histogram(distance_detected,bins=30,range=range) +hist,bins = np.histogram(distance, bins=30, range=range) +result = hist_detected*1./hist +plt.bar(bins[1:],result,width=np.diff(bins)[1]) +plt.show() -- cgit v1.2.3-70-g09d2