-
Notifications
You must be signed in to change notification settings - Fork 133
/
Copy pathget_imdb.m
34 lines (27 loc) · 840 Bytes
/
get_imdb.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
function [ imdb ] = get_imdb( datasetName, varargin )
%GET_IMDB Get imdb structure for the specified dataset
% datasetName
% should be name of a directory under '/data'
% 'func'
% the function that actually builds the imdb
% default: @setup_imdb_generic
% 'rebuild'
% whether to rebuild imdb if one exists already
% default: false
args.func = @setup_imdb_generic;
args.rebuild = false;
args = vl_argparse(args,varargin);
datasetDir = fullfile('data',datasetName);
imdbPath = fullfile(datasetDir,'imdb.mat');
if ~exist(datasetDir,'dir'),
error('Unknown dataset: %s', datasetName);
end
if exist(imdbPath,'file') && ~args.rebuild,
fprintf('Loading imdb from %s ...', imdbPath);
imdb = load(imdbPath);
fprintf(' done!\n');
else
imdb = args.func(datasetDir);
save(imdbPath,'-struct','imdb');
end
end