Directory structure and labeling in Caffe

二次信任 提交于 2019-12-11 02:05:38

问题


I would like to check if my understanding in organizing my folders and labeling is correct regarding Caffe's way of doing it.

My train directory structure looks like below:

~/Documents/software_dev/caffe/data/smalloffice/images/train
a_person  
not_a_person 
train.txt

where both a_person and not_a_person are directories.

My train.txt file looks like below:

train.txt:
----------
not_a_person/1_rotated.jpg 0
not_a_person/2_rotated.jpg 0
not_a_person/3_rotated.jpg 0
not_a_person/4_rotated.jpg 0
not_a_person/5_rotated.jpg 0
...
...
...
a_person/947_rotated.jpg 1
...
...
...

Likewise, my val directory structure looks like below:

~/Documents/software_dev/caffe/data/smalloffice/images/val
a_person  
not_a_person 
val.txt

where both a_person and not_a_person are directories.

My val.txt file looks like below:

val.txt:
--------
not_a_person/1_rotated.jpg 0
not_a_person/2_rotated.jpg 0
not_a_person/3_rotated.jpg 0
...
...
...
a_person/152_rotated.jpg 1
...
...
...

Referring to to ilsvrc12, the content of train.txt and val.txt (hence, its structure) is as follows:

train.txt:
----------
n01440764/n01440764_10026.JPEG 0
n01440764/n01440764_10027.JPEG 0
n01440764/n01440764_10029.JPEG 0
n01440764/n01440764_10040.JPEG 0
...
...
...

val.txt:
--------
ILSVRC2012_val_00000001.JPEG 65
ILSVRC2012_val_00000002.JPEG 970
ILSVRC2012_val_00000003.JPEG 230
ILSVRC2012_val_00000004.JPEG 809
...
...
...

What has confused me is actually as opposed to what is structured in ilsvrc12, the val directory contains no subdirectories i.e. contains no grouping. Is there any effect on my classification? I am stuck at getting an accuracy which is constant of 0.5 (see here) which triggers me to check if I performed correctly regarding the labeling and folder structure.

Any hints and suggestions are welcome.


回答1:


No, the directory structure has no bearing on your evaluation at all. The evaluation step takes the image files in your val.txt, runs the image through, and compares the classification result with the number next to that image filename. The directories is for human-readability not computer-readability, so it should have no bearing on your 0.5 accuracy.



来源:https://stackoverflow.com/questions/42559763/directory-structure-and-labeling-in-caffe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!