diff options
| author | Jon Whiteaker <jbw@jon-Latitude-D630> | 2012-02-20 16:00:11 -0800 |
|---|---|---|
| committer | Jon Whiteaker <jbw@jon-Latitude-D630> | 2012-02-20 16:00:11 -0800 |
| commit | 424037ed15743d37ae2c0bc330bb9b66423a28b4 (patch) | |
| tree | 7d668d47318b893a2b1433df98d51dd78459a872 /data/face-run-recognition-accuracy.py | |
| parent | ebc3844ae6598a05f922c31d382bc3100ffdd73d (diff) | |
| parent | e59601a109ad24b6226d37a76ac849ba3da8f1df (diff) | |
| download | kinect-424037ed15743d37ae2c0bc330bb9b66423a28b4.tar.gz | |
resolved conflict
Diffstat (limited to 'data/face-run-recognition-accuracy.py')
| -rwxr-xr-x | data/face-run-recognition-accuracy.py | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/data/face-run-recognition-accuracy.py b/data/face-run-recognition-accuracy.py new file mode 100755 index 0000000..00feb8f --- /dev/null +++ b/data/face-run-recognition-accuracy.py @@ -0,0 +1,53 @@ +#!/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) + +for line in open(sys.argv[1]): + line = line.split(',') + try: + run = int(line[2]) + 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[2]) + 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(user)] += 1 + prun = run + +t=0.0 +tp=0.0 +fp=0.0 +fn=0.0 +for (k,v) in runs.items(): + if v == 0: + fn += 1 + elif v != labels[k]: + fp += 1 + else: + tp += 1 + t += 1 + +print("True positives: ",tp/t) +print("False positives: ",fp/t) +print("False negatives: ",fn/t) + |
