summaryrefslogtreecommitdiffstats
path: root/data/face-frame-recognition-accuracy.py
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2012-03-05 12:48:37 -0800
committerThibaut Horel <thibaut.horel@gmail.com>2012-03-05 12:48:37 -0800
commit898bd8d0cc84064c9e56c48bd73941d965c6480a (patch)
treed39fe0e3adfa0f31c5fe8848e912187802401d12 /data/face-frame-recognition-accuracy.py
parent27b82b9eaf26474a346638a03f7edfd2f79740b4 (diff)
downloadkinect-898bd8d0cc84064c9e56c48bd73941d965c6480a.tar.gz
Some changes in face vs skeleton recognition plots
Diffstat (limited to 'data/face-frame-recognition-accuracy.py')
-rwxr-xr-xdata/face-frame-recognition-accuracy.py32
1 files changed, 11 insertions, 21 deletions
diff --git a/data/face-frame-recognition-accuracy.py b/data/face-frame-recognition-accuracy.py
index d32af9f..1f06329 100755
--- a/data/face-frame-recognition-accuracy.py
+++ b/data/face-frame-recognition-accuracy.py
@@ -12,10 +12,7 @@ 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
+top_users = np.loadtxt(sys.argv[4])[-5:,1]
for line in open(sys.argv[1]):
line = line.split(',')
@@ -30,24 +27,17 @@ for line in open(sys.argv[1]):
for line in open(sys.argv[2]):
line = line.split(',')
- try:
- run = int(line[3])
- except:
- continue
+ run = int(line[3])
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
- maxc = float(line[7])
- i = 9
- cvec = [maxc]
- while i < len(line):
- cvec += [float(line[i])]
- i += 2
- conf[run] = (maxc/100.0)*(maxc/(np.sum(cvec)))
- prun = run
+ if users.index(user)+1 in top_users:
+ i = 6
+ while i < len(line)-1:
+ pred_user = ' '.join(line[i].split('@')[0].split('_'))
+ if users.index(pred_user)+1 in top_users:
+ conf[run] = float(line[i+1])/100
+ runs[run] = users.index(pred_user)+1
+ break
+ i += 2
for i in range(999)+list(np.arange(999,1000,0.01)):
thresh = i/1000.0