-
Notifications
You must be signed in to change notification settings - Fork 0
/
VOCinit_train.m
130 lines (95 loc) · 3.25 KB
/
VOCinit_train.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
clear VOCopts
% use VOC2006 or VOC2007 data
VOC2006=false; % set true to use VOC2006 data
% dataset
if VOC2006
VOCopts.dataset='VOC2006';
else
VOCopts.dataset='VOC2007_train';
end
% get current directory with forward slashes
cwd=cd;
cwd(cwd=='\')='/';
% change this path to point to your copy of the PASCAL VOC data
VOCopts.datadir=[cwd '/'];
% change this path to a writable directory for your results
VOCopts.resdir=[cwd '/results/' VOCopts.dataset '/'];
% change this path to a writable local directory for the example code
VOCopts.localdir=[cwd '/local/' VOCopts.dataset '/'];
% initialize the test set
VOCopts.testset='val'; % use validation data for development test set
% VOCopts.testset='test'; % use test set for final challenge
% initialize main challenge paths
VOCopts.annopath=[VOCopts.datadir VOCopts.dataset '/Annotations/%s.xml'];
VOCopts.imgpath=[VOCopts.datadir VOCopts.dataset '/JPEGImages/%s.jpg'];
VOCopts.imgsetpath=[VOCopts.datadir VOCopts.dataset '/ImageSets/Main/%s.txt'];
VOCopts.clsimgsetpath=[VOCopts.datadir VOCopts.dataset '/ImageSets/Main/%s_%s.txt'];
VOCopts.clsrespath=[VOCopts.resdir 'Main/%s_cls_' VOCopts.testset '_%s.txt'];
VOCopts.detrespath=[VOCopts.resdir 'Main/%s_det_' VOCopts.testset '_%s.txt'];
% initialize segmentation task paths
VOCopts.seg.clsimgpath=[VOCopts.datadir VOCopts.dataset '/SegmentationClass/%s.png'];
VOCopts.seg.instimgpath=[VOCopts.datadir VOCopts.dataset '/SegmentationObject/%s.png'];
VOCopts.seg.imgsetpath=[VOCopts.datadir VOCopts.dataset '/ImageSets/Segmentation/%s.txt'];
VOCopts.seg.clsresdir=[VOCopts.resdir 'Segmentation/%s_%s_cls'];
VOCopts.seg.instresdir=[VOCopts.resdir 'Segmentation/%s_%s_inst'];
VOCopts.seg.clsrespath=[VOCopts.seg.clsresdir '/%s.png'];
VOCopts.seg.instrespath=[VOCopts.seg.instresdir '/%s.png'];
% initialize layout task paths
VOCopts.layout.imgsetpath=[VOCopts.datadir VOCopts.dataset '/ImageSets/Layout/%s.txt'];
VOCopts.layout.respath=[VOCopts.resdir 'Layout/%s_layout_' VOCopts.testset '_%s.xml'];
% initialize the VOC challenge options
if VOC2006
% VOC2006 classes
VOCopts.classes={...
'bicycle'
'bus'
'car'
'cat'
'cow'
'dog'
'horse'
'motorbike'
'person'
'sheep'};
else
% VOC2007 classes
VOCopts.classes={...
'aeroplane'
'bicycle'
'bird'
'boat'
'bottle'
'bus'
'car'
'cat'
'chair'
'cow'
'diningtable'
'dog'
'horse'
'motorbike'
'person'
'pottedplant'
'sheep'
'sofa'
'train'
'tvmonitor'};
end
VOCopts.nclasses=length(VOCopts.classes);
VOCopts.poses={...
'Unspecified'
'SideFaceLeft'
'SideFaceRight'
'Frontal'
'Rear'};
VOCopts.nposes=length(VOCopts.poses);
VOCopts.parts={...
'head'
'hand'
'foot'};
VOCopts.maxparts=[1 2 2]; % max of each of above parts
VOCopts.nparts=length(VOCopts.parts);
VOCopts.minoverlap=0.5;
% initialize example options
VOCopts.exannocachepath=[VOCopts.localdir '%s_anno.mat'];
VOCopts.exfdpath=[VOCopts.localdir '%s_fd.mat'];