-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsetup.m
More file actions
36 lines (30 loc) · 1.1 KB
/
Copy pathsetup.m
File metadata and controls
36 lines (30 loc) · 1.1 KB
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
function setup()
% SETUP Setup the environment
% Copyright (C) 2016 Karel Lenc.
% All rights reserved.
%
% Tishis file is part of the VLFeat library and is made available under
% the terms of the BSD license (see the COPYING file).
% Setup VLFeat, if not in path
if ~exist('vl_covdet', 'file')
utls.provision('vlfeat.url', 'vlfeat');
run(fullfile(getlatest('vlfeat', 'vlfeat'), 'toolbox', 'vl_setup.m'));
end
% Setup MatConvNet, if not in path
if ~exist('vl_nnconv', 'file')
utls.provision('matconvnet.url', 'matconvnet');
run(fullfile(getlatest('matconvnet', 'matconvnet'), 'matlab', 'vl_setupnn.m'));
if isempty(strfind(which('vl_nnconv'), mexext))
fprintf('MatConvNet not compiled. Attempting to run `vl_compilenn` (CPU ONLY!).\n');
fprintf('To compile with a GPU support, see `help vl_compilenn`.');
vl_compilenn('EnableImreadJpeg', false);
end
end
utls.provision(fullfile('nets', 'nets.url'), 'nets');
end
function out = getlatest(path, name)
sel_dir = dir(fullfile(path, [name '*']));
sel_dir = sel_dir([sel_dir.isdir]);
sel_dir = sort({sel_dir.name});
out = fullfile(path, sel_dir{end});
end