diff options
| author | Jon Whiteaker <jbw@berkeley.edu> | 2012-02-28 22:34:45 -0800 |
|---|---|---|
| committer | Jon Whiteaker <jbw@berkeley.edu> | 2012-02-28 22:35:48 -0800 |
| commit | 5ad8ad0aed2ce26bdbf3cc6345b9af0b5397695a (patch) | |
| tree | c7a79c813b9311bd0dd308b60ac976fa99ebb36c /data | |
| parent | 7dc01b33cadc6d565821e19db2bb006f5b1a211f (diff) | |
| download | kinect-5ad8ad0aed2ce26bdbf3cc6345b9af0b5397695a.tar.gz | |
changing paper outline
Diffstat (limited to 'data')
| -rwxr-xr-x | data/face-frame-recognition-accuracy.py | 63 | ||||
| -rw-r--r-- | data/face-pr.csv | 23 |
2 files changed, 86 insertions, 0 deletions
diff --git a/data/face-frame-recognition-accuracy.py b/data/face-frame-recognition-accuracy.py new file mode 100755 index 0000000..0d34cf9 --- /dev/null +++ b/data/face-frame-recognition-accuracy.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +import os +import sys +import pickle + +prun = 0 +runs = {} +labels = {} +users = pickle.load((open(sys.argv[3]))) +recs = map(lambda x:0,users) +conf = {} +thresh = 0.0 +try: + thresh = float(sys.argv[4]) +except: + pass + +for line in open(sys.argv[1]): + line = line.split(',') + try: + run = int(line[3]) + except: + continue + user = line[1] + if run not in runs: + runs[run] = 0 + labels[run] = users.index(user) + 1 + +for line in open(sys.argv[2]): + line = line.split(',') + try: + run = int(line[3]) + except: + continue + user = line[1] + rec = ' '.join(line[6].split('@')[0].split('_')) + if run != prun and prun > 0: + runs[prun] = recs.index(max(recs))+1 + recs = map(lambda x:0,users) + recs[users.index(rec)] += 1 + conf[run] = float(line[7]) + prun = run + +t=0.0 +tp=0.0 +fp=0.0 +fn=0.0 +for (k,v) in runs.items(): + #print v,labels[k] + if v == 0 or conf[k] < thresh: + fn += 1 + elif v != labels[k]: + fp += 1 + else: + tp += 1 + t += 1 +#print runs[167],labels[167] +#print tp,fp,fn +#print("Precision: ",tp/(tp+fp)) +#print("False positives: ",fp/(tp+fp)) +#print("Recall: ",1.0-fn/t) +print str(tp/(tp+fp))+","+str(1.0-fn/t) + diff --git a/data/face-pr.csv b/data/face-pr.csv new file mode 100644 index 0000000..d595d13 --- /dev/null +++ b/data/face-pr.csv @@ -0,0 +1,23 @@ +0.292700597718,0.655321782178 +0.292700597718,0.655321782178 +0.29179496468,0.657355679702 +0.291432711465,0.658172778123 +0.290708205035,0.659190031153 +0.286904546278,0.664141414141 +0.280383988408,0.675064599483 +0.268973012135,0.693602693603 +0.250860351386,0.718411552347 +0.247600072451,0.725676664228 +0.243796413693,0.731797919762 +0.241260641188,0.734234234234 +0.237275855823,0.739694656489 +0.232204310813,0.751170046802 +0.230030791523,0.754330708661 +0.227857272233,0.757551669316 +0.205759826118,0.779049295775 +0.205759826118,0.779049295775 +0.205759826118,0.779049295775 +0.205759826118,0.779049295775 +0.199963774679,0.790760869565 +0.132946929904,0.893732970027 +0.0791523274769,0.929061784897 |
