-
Notifications
You must be signed in to change notification settings - Fork 1
/
create_PRgraphs_TSVM1.m
executable file
·59 lines (36 loc) · 1.66 KB
/
create_PRgraphs_TSVM1.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
function create_PRgraphs_TSVM1()
run('vlfeat/toolbox/vl_setup');
tsvm_path = fullfile('svmlin_TSVM_Method1/');
videos = {'girl', 'birdfall2','cheetah', 'monkeydog', 'parachute', 'penguin' };
extension1 = {'bmp', 'png','bmp', 'bmp', 'png', 'bmp' };
extension2 = {'bmp', 'png','png', 'png', 'png', 'png' };
num_videos = length(videos);
for i=1:num_videos
video_name = videos{i};
file_outputs = fullfile(tsvm_path, strcat ( video_name, '.output.outputs'));
fid_outputs = fopen(file_outputs);
outputs_info = textscan(fid_outputs, '%f');
file_train_labels = fullfile(tsvm_path, strcat ( video_name, '_trainlabelssvm'));
fid_train_labels = fopen(file_train_labels);
train_labels_info = textscan(fid_train_labels, '%d');
file_test_labels = fullfile(tsvm_path, strcat ( video_name, '_testlabelssvm'));
fid_test_labels = fopen(file_test_labels);
test_labels_info = textscan(fid_test_labels, '%d');
trueLabels = test_labels_info{1,1}(:);
scores = outputs_info{1,1}(:);
figure( 1 );
%[prec, tpr, fpr, thresh] =
%prec_rec(scores, double(trueLabels));
%[RECALL, PRECISION] = vl_pr(trueLabels, scores);
%[tp, fp, p, n, perm, varargin] = vl_tpfp(trueLabels, scores) ;
%figure;
%trueLabels(find(trueLabels ==0)) =-1;
vl_pr(trueLabels, scores) ;
%saveas( gcf, strcat(video_name,'_TSVM1'), 'jpg' );
saveas(gcf, strcat(video_name,'_TSVM1.pdf')); %'filename.pdf')
%saveas(video_name);
%vl_pr(trueLabels+10, scores+10) ;hold on
%[recall, precision] = vl_roc(trueLabels, scores) ;
end
%close all;
end