summaryrefslogtreecommitdiffstats
path: root/data/combined/graphs/plots.py
blob: 5fd3c2ca3d0bdbf16bbf512b5c0cda15d6912953 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#! /usr/bin/python

import numpy as np
import matplotlib.pyplot as plt

#frames distribution
plt.cla()
x = np.loadtxt("frames.txt",usecols=(0,))
y = range(1,len(x)+1)
width=0.8
plt.bar(y,x/x.sum()*100,width=width)
plt.xlim(0.8,25)
plt.xticks([i+width/2. for i in range(1,len(x),5)], range(1,len(x),5))
plt.xlabel("Individual")
plt.ylabel("Frame ratio [%]")
plt.ylim(0,10)
plt.savefig("frames.pdf")

l = ["3","5","10","all"]

#10-fold, naive
plt.cla()
ax = plt.subplot(121)
plt.axis([0,100,50,100])
ax.set_aspect(2)
for i in l:
    x,y = np.loadtxt(i+"_nb_off.mat",unpack=True)
    plt.plot(100*x,100*y,label="$n=$ "+i,linewidth=0.8)
    plt.xlabel("Recall [%]")
    plt.ylabel("Precision [%]")
    plt.legend(loc="best")
#10-fold, SHT
ax = plt.subplot(122)
plt.axis([0,100,50,100])
ax.set_aspect(2)
for i in l:
    x,y = np.loadtxt(i+"_sht_off.mat",unpack=True)
    plt.plot(100*x,100*y,label="$n=$ "+i,linewidth=0.8)
    plt.xlabel("Recall [%]")
    plt.ylabel("Precision [%]")
    plt.legend(loc="best")

plt.axis([0,100,50,100])
plt.savefig("10fold.pdf")

#online,SHT
plt.cla()
for i in l:
    x,y = np.loadtxt(i+"_sht_on.mat",unpack=True)
    plt.plot(100*x,100*y,label="$n=$ "+i,linewidth=0.8,markersize=4)
    plt.xlabel("Recall [%]")
    plt.ylabel("Precision [%]")
    plt.legend(loc="best")
plt.savefig("online-sht.pdf")


#face
plt.cla()
x,y = np.loadtxt("all_nb_off.mat",unpack=True)
a,b = np.loadtxt("face.csv",delimiter=",", unpack=True)
plt.plot(100*x,100*y,linewidth=0.8,label="Skeleton")
plt.plot(100*a,100*b,linewidth=0.8,label="Face")
plt.xlabel("Recall [%]")
plt.ylabel("Precision [%]")
plt.legend(loc="best")
plt.savefig("face.pdf")

#back
plt.cla()
x,y = np.loadtxt("back_all_sht_on.mat",unpack=True)
a,b = np.loadtxt("all_sht_on.mat",unpack=True)
plt.plot(100*x,100*y,linewidth=0.8,label="Away")
plt.plot(100*a,100*b,linewidth=0.8,label="Toward")
plt.xlabel("Recall [%]")
plt.ylabel("Precision [%]")
plt.legend(loc="best")
plt.savefig("back.pdf")

#variance-reduction
plt.cla()
x,y = np.loadtxt("half-var-all_sht_on.mat",unpack=True)
a,b = np.loadtxt("all_sht_on.mat",unpack=True)
plt.plot(100*x,100*y,linewidth=0.8,label="Reduced noise")
plt.plot(100*a,100*b,linewidth=0.8,label="Original noise")
plt.xlabel("Recall [%]")
plt.ylabel("Precision [%]")
plt.legend(loc="best")
plt.savefig("var.pdf")