diff options
| author | Jon Whiteaker <jbw@berkeley.edu> | 2012-03-02 18:22:30 -0800 |
|---|---|---|
| committer | Jon Whiteaker <jbw@berkeley.edu> | 2012-03-02 19:27:57 -0800 |
| commit | dab0508530bb34b0ff7634bba43b9345428f4c90 (patch) | |
| tree | 9908d45ca879384b2f4987e9b7485fb6e841502e /data/face-frame-recognition-accuracy.py | |
| parent | 712882a6e821032f39963ad071273769c2f0cb91 (diff) | |
| download | kinect-dab0508530bb34b0ff7634bba43b9345428f4c90.tar.gz | |
new face pr curve
Diffstat (limited to 'data/face-frame-recognition-accuracy.py')
| -rwxr-xr-x | data/face-frame-recognition-accuracy.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/data/face-frame-recognition-accuracy.py b/data/face-frame-recognition-accuracy.py index 3ff0aa8..48b6141 100755 --- a/data/face-frame-recognition-accuracy.py +++ b/data/face-frame-recognition-accuracy.py @@ -3,6 +3,7 @@ import numpy as np import os import sys import pickle +import math prun = 0 runs = {} @@ -39,18 +40,26 @@ for line in open(sys.argv[2]): runs[prun] = recs.index(max(recs))+1 recs = map(lambda x:0,users) recs[users.index(rec)] += 1 - conf[run] = float(line[7]) + maxc = float(line[7])/100.0 + i = 9 + cvec = [] + while len(cvec) < len(users)-1: + if i < len(line): + cvec += [float(line[i])/100.0 - maxc] + else: + cvec += [-maxc] + conf[run] = math.log(np.sum(np.exp(cvec))) prun = run for i in range(999)+list(np.arange(999,1000,0.01)): - thresh = i/10 + thresh = 5-i/100.0 t=0.0 tp=0.0 fp=0.0 fn=0.0 for (k,v) in runs.items(): #print v,labels[k] - if conf[k] < thresh: + if conf[k] > thresh: fn += 1 elif v != labels[k]: fp += 1 |
