-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUFL_loading.m
More file actions
35 lines (28 loc) · 1.06 KB
/
UFL_loading.m
File metadata and controls
35 lines (28 loc) · 1.06 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
close all;
clc;
%add matlab library
addpath(addpath(genpath('../matlablib/edges-master')));
addpath(addpath(genpath('../matlablib/toolbox')));
%run(fullfile(fileparts(fileparts(mfilename('fullpath'))), 'startup'));
%% -------------------- CONFIG --------------------
opts.gpu_id = auto_select_gpu;
active_caffe_mex(opts.gpu_id);
opts.use_gpu = true;
%% -------------------- INIT_MODEL --------------------
model_dir = fullfile(pwd, 'models','UFL');%model path
model = load(fullfile(model_dir, 'conf'));% loading other config
model.metric_net_def = fullfile(model_dir,'test.prototxt');%model prototxt
model.metric_net = fullfile(model_dir,'iter_150000');%model parameter
model.conf_metric.test_scales = model.conf_metric.scales;
if opts.use_gpu
model.conf_metric.image_means = gpuArray(model.conf_metric.image_means);
end
% proposal net
metric_net = caffe.Net(model.metric_net_def, 'test');
metric_net.copy_from(model.metric_net);
% set gpu/cpu
if opts.use_gpu
caffe.set_mode_gpu();
else
caffe.set_mode_cpu();
end