forked from PKU-ICST-MIPL/OPAM_TIP2018
-
Notifications
You must be signed in to change notification settings - Fork 0
/
readvisionfeature.m
23 lines (23 loc) · 841 Bytes
/
readvisionfeature.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function [feature] = readvisionfeature(featurepath , featureDim , testNum, scale)
if nargin<4
scale = 1;
end
totaltest = testNum ;
scale = 1.8;
feature = load(featurepath);
for i = 1 : featureDim
feature(:,i) = sign(feature(:,i)) .* abs(feature(:,i)) .^ (1/scale);% the best
end
feature = exp(feature);
sumOfRowfeature = sum(feature,2);
sumOfRowfeature = repmat(sumOfRowfeature , 1 , featureDim) ;
feature = feature ./ sumOfRowfeature;
feature = pre_cnn(feature);
feature = feature(1:totaltest,:) ;
[scores , classes] = max(feature ,[] , 2) ;
classes = classes - 1 ;
[list, gt] = textread('./datalist/car_test.list' , '%s %d');
gt_bbox = gt;
presion_fusion = length(find((classes - gt_bbox) == 0)) / testNum ;
fprintf('%f\n' , presion_fusion);
end