rcnn_load_cached_pool5_features.m 1.07 KB
Newer Older
Ross Girshick's avatar
Ross Girshick committed
1
2
3
function d = rcnn_load_cached_pool5_features(cache_name, imdb_name, id)
% loads feat_cache/[cache_name]/[split]/[id].mat

Ross Girshick's avatar
Ross Girshick committed
4
5
6
7
8
9
10
11
12
13
14
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
% 
% This file is part of the R-CNN code and is available 
% under the terms of the Simplified BSD License provided in 
% LICENSE. Please retain this notice and LICENSE if you use 
% this file (or any portion of it) in your project.
% ---------------------------------------------------------


Ross Girshick's avatar
Ross Girshick committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
file = sprintf('./feat_cache/%s/%s/%s', cache_name, imdb_name, id);

if exist([file '.mat'], 'file')
  d = load(file);
else
  warning('could not load: %s', file);
  d = create_empty();
end

% standardize boxes to double (for overlap calculations, etc.)
d.boxes = double(d.boxes);


% ------------------------------------------------------------------------
function d = create_empty()
% ------------------------------------------------------------------------
d.gt = logical([]);
d.overlap = single([]);
d.boxes = single([]);
d.feat = single([]);
d.class = uint8([]);