-
Notifications
You must be signed in to change notification settings - Fork 977
/
rcnn_load_cached_pool5_features.m
37 lines (30 loc) · 1.17 KB
/
rcnn_load_cached_pool5_features.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
function d = rcnn_load_cached_pool5_features(cache_name, imdb_name, id)
% d = rcnn_load_cached_pool5_features(cache_name, imdb_name, id)
% loads cached pool5 features from:
% feat_cache/[cache_name]/[imdb_name]/[id].mat
% 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.
% ---------------------------------------------------------
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([]);