-
Notifications
You must be signed in to change notification settings - Fork 20
/
init.m
92 lines (74 loc) · 3.97 KB
/
init.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
%% Mid-level Deep Pattern Mining, CVPR 2015
%% Mining Mid-level Visual Patterns with Deep CNN Activations, ArXiv preprint, 2015
% Yao Li, University of Adelaide, March 2016
%% paths to some libraries
% path to liblinear, change this based on your configuration
conf.pathToLiblinear = '~/Vision/lib/liblinear-1.94/';
addpath(genpath(conf.pathToLiblinear));
%% path to Caffe, change this based on your configuration
conf.pathToCaffe = '/home/yao/Project/CNN/caffe';
%% path to Caffe CNN models (select one below, models are downloaded from Caffe Model Zoo)
% (1) BVLC Reference CaffeNet model
conf.modelName = 'CaffeRef';
conf.pathToModel = [conf.pathToCaffe,'/models/bvlc_reference_caffenet'];
% (2) VGG 19-layer Very Deep model
% conf.modelName = 'VGGVD';
% conf.pathToModel = [conf.pathToCaffe,'/models/vgg-vd'];
%% path to Caffe's matlab interface, you need to compile it using "make matcaffe"
conf.pathToMatCaffe = [conf.pathToCaffe,'/matlab/'];
%% dataset
%(1)
conf.dataset = 'MIT67';
conf.imgDir = ['~/Vision/dataset/',conf.dataset]; % path the dataset, change this based on your configuration
conf.imdb = 'MIT67-imdb.mat'; % train/test splits of the dataset.
conf.numClasses = 67 ;
conf.numSamples = 100;
%(2)
% conf.dataset = 'VOC2007';
% conf.imgDir = ['~/Vision/dataset/VOCdevkit/',conf.dataset,'/JPEGImages'];%path the dataset;
% conf.splitDir = ['~/Vision/dataset/VOCdevkit/',conf.dataset,'/ImageSets/Main'];
% conf.annoDir = ['~/Vision/dataset/VOCdevkit/',conf.dataset,'/Annotations/'];
% conf.imdb = 'VOC2007-imdb.mat';% train/test splits of the dataset.
% conf.numClasses = 20;
%(3)
% conf.dataset = 'VOC2012';
% conf.imgDir = ['~/Vision/dataset/VOCdevkit/',conf.dataset,'/JPEGImages'];%path the dataset;
% conf.splitDir = ['~/Vision/dataset/VOCdevkit/',conf.dataset,'/ImageSets/Main'];
% conf.imdb = 'VOC2012-imdb.mat';%; % train/test splits of the dataset.
% conf.numClasses = 20;
%% assoication rule mining
conf.numTop = 20;
conf.numTopActivation = 20;
conf.numDetSelected = 50;
conf.stepSize = 32;
conf.minLength = 3;
conf.maxLength = 6;
conf.patchSize = 128;
conf.patchSizeL2 = 160;
conf.patchSizeL3 = 192;
conf.supp = 0.01;
conf.confid = 30; %30 for MIT Indoor dataset, 80 (30) for VOC datasets if using CaffeRef (VGGVD) model
%% other parameters
conf.svmC = 0.5; % C value for training svm detector
conf.detLDATh = 150;
conf.detTh = 50;
conf.overlap = 0.1;
%% directories
% cnn directories
conf.cnnDir_Local = ['cnn_',num2str(conf.patchSize),'_',num2str(conf.stepSize)];
conf.cnnDir_Local_L2 = ['cnn_',num2str(conf.patchSizeL2),'_',num2str(conf.stepSize)];
conf.cnnDir_Local_L3 = ['cnn_',num2str(conf.patchSizeL3),'_',num2str(conf.stepSize)];
conf.cnnDir_Combined = ['cnnCom_',num2str(conf.patchSize),'_',num2str(conf.stepSize)];
% data directories
conf.dataDir = [pwd,'/data/',conf.dataset];
conf.invertFileDir = ['invert_',num2str(conf.patchSize),'_',num2str(conf.stepSize),'_',num2str(conf.numTopActivation)];
conf.transFileDir = ['trans_',num2str(conf.patchSize),'_',num2str(conf.stepSize),'_',num2str(conf.numTopActivation)];
conf.ruleDir_init = ['rule_init_',num2str(conf.patchSize),'_',num2str(conf.stepSize),'_',num2str(conf.numTopActivation),'_',num2str(conf.supp),'_',num2str(conf.confid)];
conf.clusterDir_init = ['cluster_init_',num2str(conf.patchSize),'_',num2str(conf.stepSize),'_',num2str(conf.numTopActivation),'_',num2str(conf.supp),'_',num2str(conf.confid)];
conf.clusterDir_merge = ['cluster_merge_',num2str(conf.patchSize),'_',num2str(conf.stepSize),'_',num2str(conf.detLDATh),'_',num2str(conf.numTopActivation),'_',num2str(conf.supp),'_',num2str(conf.confid)];
conf.detDir_lda = ['detFinal_lda_',num2str(conf.patchSize),'_',num2str(conf.stepSize),'_',num2str(conf.detLDATh)];
conf.detComDir_lda = ['detCom_lda_',num2str(conf.patchSize),'_',num2str(conf.stepSize),'_',num2str(conf.detLDATh)];
conf.modelDir = 'model';
conf.APDir = 'AP';
% image representation directories
conf.feaDir = ['feaFinal_',num2str(conf.patchSize),'_',num2str(conf.stepSize),'_',num2str(conf.detLDATh)];