-
Notifications
You must be signed in to change notification settings - Fork 237
/
spp_load_pooling_params.m
32 lines (27 loc) · 1.01 KB
/
spp_load_pooling_params.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
function spp_params = spp_load_pooling_params(spp_params_def)
% spp_params = spp_load_pooling_params(spp_params_def)
% spp_params -- parameters for spatial pyramid pooling for spatial model
%
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Shaoqing Ren
%
% This file is part of the SPP 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.
% ---------------------------------------------------------
[~, ~, ext] = fileparts(spp_params_def);
if isempty(ext)
spp_params_def = [spp_params_def, '.m'];
end
assert(exist(spp_params_def, 'file') ~= 0);
% change folder to avoid too long path for eval()
cur_dir = pwd;
[spp_def_dir, spp_def_file] = fileparts(spp_params_def);
cd(spp_def_dir);
spp_params = eval(spp_def_file);
cd(cur_dir);
spp_params.expected_scale = @spm_expected_scale;
spp_params.response_boxes = @spm_response_boxes;
end