-
Notifications
You must be signed in to change notification settings - Fork 0
/
setParams.m
54 lines (48 loc) · 1.28 KB
/
setParams.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
%SETPARAMS Sets parameters as global variables
% Detailed explanation goes here
global paintPath labelNames imgNameExt nArtistsPerLbl nTrainImgsPerArtist
global nTestImgsPerArtist smallSize nDsiftSteps vocabSize nHistBins
global imgBlocks edgeFilt nLbls labels A C I P R S nTrainImgsPerLbl
global nTestImgsPerLbl nTrainImgs nTestImgs gaussFilt
% Image loading parameters
paintPath = 'paintings';
labelNames = {
'abstract';
'cubism';
'impressionism';
'pointillism';
'renaissance';
'surrealism';
};
A = 1;
C = 2;
I = 3;
P = 4;
R = 5;
S = 6;
imgNameExt = 'jpg';
nArtistsPerLbl = 5;
nTrainImgsPerArtist = 10;
nTestImgsPerArtist = 10;
sig = 0.5; % default: 0.5
smallSize = [200 200];
% Feature extraction parameters
nDsiftSteps = 4; % default: 1
vocabSize = 200;
nHistBins = 64;
imgBlocks = -1;%[1 1];
edgeFilt = fspecial('log');
% --- COMPUTED PARAMETERS ---
nLbls = numel(labelNames);
labels = 1:nLbls;
nTrainImgsPerLbl = nArtistsPerLbl * nTrainImgsPerArtist;
nTestImgsPerLbl = nArtistsPerLbl * nTestImgsPerArtist;
nTrainImgs = nLbls * nTrainImgsPerLbl;
nTestImgs = nLbls * nTestImgsPerLbl;
filtSize = (floor(3*sig) * 2 + 1) * ones(2,1);
gaussFilt = fspecial('gaussian', filtSize, sig);
clear sig filtSize
% Creates directory for caching data
if ~exist('data', 'dir')
mkdir('data')
end