-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.txt
52 lines (47 loc) · 2.87 KB
/
notes.txt
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
% In vanilla, names is a 1x60658 cell array of directory/imagename.JPEG
% where directory is the directory directly containing the image. I *THINK*
% that the directory name is typically the category ID of the enclosed
% images, e.g. if there is a directory called n02119789, then
% n02119789/image1.JPEG, n02119789/image2.JPG, ..., n02119789/imagek.JPEG
% are all of the training images of class n02119789. There is presumably
% one such directory for each of the classes.
% The variable d loops through each of the directories (each directory has
% multiple images in that class). d.name is the name of the directory, e.g.
% n02119789 (the name of the category). [~,lab] = ... returns into lab the
% index of 'cats' that d.name (the category) is, if it's in that array at
% all. For example, if d.name = n02119789 and n02119789is the 900'th
% element of cats, then lab=900.
% Hence, 'labels' is a 1x60658 array where each entry is the index/number
% of the category that belongs to the respective image.
In setup_data files, the same general pattern holds for storing train,
val, and test data into imdb.
% The above pattern continues below for validation and test images. It just
% adds those images to the end of imdb.images.id etc. So for example,
% imdb.images.name is [classA/im1.JPG, classA/im2.JPG, ..., classA/imk.JPG,
% classB/... , ... , ... , classZ/imK.JPG, val/valImg1.JPG,
% val/valImg2.JPG, val/valImg3.JPG, ..., test/testImg1.JPG,
% test/testImg2.JPG, ...]
% The reaason that they add 1e7 to the IDs is just so offset them enough so
% that there's no confusion about what IDs belong to what. So the training
% images have IDs from 1 to numel(trainImages), the validation images have
% IDs from 10000000 to 10000000+numel(valImages), the test images have IDs
% from 20000000 to 20000000+numel(testImages). Note also that
% imdb.images.set is 2 for validation, 3 for test, and 1 for train.
% We probably don't have to worry about post-processing for now.
% All imdb.* fields are 1 x n (not n x 1)
% imdb.classes.name = {className1, className2, ...}
% imdb.classes.description = {classDescr1, classDescr2, ...}
% where "className" is like an ID, and "classDescr" is like 'White Tiger'
% imdb.imageDir is the top level directory of the images, e.g. if we had
% data/imagenet12/images/{test,train,val} then imdb.imageDir is
% data/imagenet12/images
% imdb.images.id is an array of unique IDs of images, e.g. [1, 2, ...]
% imdb.images.name is a cell array of full path names (relative to
% imageDir) to each of the images, e.g. {train/classNameA/classAimage1.JPG,
% ...}
% imdb.images.set is an array of the set type of the images, where 1 =
% train, 2 = validate, 3 = test. So it will probably look like this:
% [1 1 1 .... 2 2 2 .... 3 3 3 ... ]
% imdb.images.label is an array, where each element is the index into the
% classes cell array that tells us to which class the image belongs. e.g.
% [28 193 930 68 ... ]