-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathstartup.m
executable file
·108 lines (86 loc) · 3.51 KB
/
startup.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
global basedir
global cachedir
global PASCAL3Ddir
global rcnnVpsPascalDataDir
global rcnnKpsPascalDataDir
global rcnnVpsImagenetDataDir
global rotationPascalDataDir
global rotationImagenetDataDir
global rotationJointDataDir
global kpsPascalDataDir
global finetuneVpsDir
global finetuneKpsDir
global params
global pascalImagesDir
global pascalDir
global annotationDir
global segkpAnnotationDir
global imagenetImagesDir
global websiteDir
global snapshotsDir
global prototxtDir
global rcnnDetectionsFile
%%
basedir = pwd();
cachedir = fullfile(basedir,'cachedir'); % directory where all the intermediate computations and data will be saved
%% These paths might need to be edited
PASCAL3Ddir = fullfile(basedir,'data','PASCAL3D');
pascalDir = fullfile(basedir,'data','VOCdevkit');
pascalImagesDir = fullfile(basedir,'data','VOCdevkit','VOC2012','JPEGImages');
imagenetImagesDir = fullfile(basedir,'data','imagenet','images');
rcnnDetectionsFile = fullfile(basedir,'data','VOC2012_val_det.mat');
segkpAnnotationDir = fullfile(basedir,'data','segkps'); %required for keypoint prediction
snapshotsDir = fullfile(cachedir,'snapshots'); %directory where caffemodels are saved - you'll have to set this up
%% The paths below should not be edited
params = getParams;
rcnnVpsPascalDataDir = fullfile(cachedir,'rcnnVpsPascalData');
rcnnVpsImagenetDataDir = fullfile(cachedir,'rcnnVpsImagenetData');
rcnnKpsPascalDataDir = fullfile(cachedir,'rcnnKpsPascalData');
kpsPascalDataDir = fullfile(cachedir,'kpsDataPascal');
annotationDir = fullfile(basedir,'data','pascalAnnotations','imgAnnotations'); %required for keypoint prediction
rotationPascalDataDir = fullfile(cachedir,'rotationDataPascal');
rotationImagenetDataDir = fullfile(cachedir,'rotationDataImagenet');
rotationJointDataDir = fullfile(cachedir,'rotationDataJoint');
finetuneVpsDir = fullfile(cachedir,'rcnnFinetuneVps');
finetuneKpsDir = fullfile(cachedir,'rcnnFinetuneKps');
websiteDir = fullfile(cachedir,'visualization'); %directory where visualizations used for the main paper will be saved
prototxtDir = fullfile(basedir,'prototxts');
%%
folders = {'analysisVp','analysisKp','detectionPose','pose','encoding','predict','evaluate','utils','visualization','evaluation','learning','preprocess','rcnnKp','rcnnVp','cnnFeatures'};
for i=1:length(folders)
addpath(genpath(folders{i}));
end
clear i;
clear folders;
mkdirOptional(cachedir);
if exist(fullfile(cachedir,'pascalTrainValIds.mat'))
load(fullfile(cachedir,'pascalTrainValIds'))
else
fIdTrain = fopen(fullfile(pascalDir,'VOC2012','ImageSets','Main','train.txt'));
trainIds = textscan(fIdTrain,'%s');
trainIds = trainIds{1};
fIdVal = fopen(fullfile(pascalDir,'VOC2012','ImageSets','Main','val.txt'));
valIds = textscan(fIdVal,'%s');
valIds = valIds{1};
save(fullfile(cachedir,'pascalTrainValIds.mat'),'trainIds','valIds');
end
if ~exist(fullfile(cachedir,'imagenetTrainIds.mat'))
fnamesTrain = generateImagenetTrainNames();
save(fullfile(cachedir,'imagenetTrainIds.mat'),'fnamesTrain');
end
mkdirOptional(rotationJointDataDir);
mkdirOptional(rotationImagenetDataDir);
mkdirOptional(rotationPascalDataDir);
mkdirOptional(kpsPascalDataDir);
mkdirOptional(annotationDir);
mkdirOptional(rcnnVpsImagenetDataDir);
mkdirOptional(rcnnVpsPascalDataDir);
mkdirOptional(rcnnKpsPascalDataDir);
mkdirOptional(finetuneVpsDir);
mkdirOptional(finetuneKpsDir);
mkdirOptional(websiteDir);
if exist('external/caffe/matlab/caffe')
addpath('external/caffe/matlab/caffe');
else
warning('Please install Caffe in ./external/caffe');
end