-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstats.m
63 lines (54 loc) · 1.52 KB
/
stats.m
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
function [] = stats()
clc
close all
warning off
addpath src
image_collection = struct;
number_of_people = 17;
success_counter = 0;
fail_counter = 0;
total_number_of_images = 0;
false_positives = 0;
false_negatives = 0;
failed_recognitions = 0;
fatal_errors = 0;
for n = 1 : number_of_people
folder_name = sprintf('img/tests/%d/', n);
mat_name = sprintf('p%d', n);
[images, number_of_images] = readAllFromDir(mat_name, folder_name, '*.jpg');
image_collection.images{n} = images;
image_collection.number_of_images{n} = number_of_images;
total_number_of_images = total_number_of_images + number_of_images;
end
progress = '';
for n = 1 : total_number_of_images
progress = strcat(progress, '-');
end
images_computed = 0;
for n = 1 : number_of_people
images = image_collection.images{n};
number_of_images = image_collection.number_of_images{n};
for k = 1 : number_of_images
image = images(k);
id = tnm034(image{1});
if n == number_of_people
if id == 0
success_counter = success_counter + 1;
else
fail_counter = fail_counter + 1;
end
else
if id == n
success_counter = success_counter + 1;
else
fail_counter = fail_counter + 1;
end
end
images_computed = images_computed + 1;
clc
disp(progress);
end
end
success_rate = success_counter / (images_computed);
disp(sprintf('Success rate: %i%%', round(success_rate * 100)));
end