Text files inside the ImageSets/Main folder

Hi,

for object detection there are four text files in the ImageSets/Main folder.
train.txt
trainval.txt
val.txt
test.txt

A good ratio of all images seems to be train 80%, val 10% and test 10% . Those files are clear to me, but not the trainval file. Which images should be selected inside this file?
Is it reasonable to select one or more images in several text files not only one? E.g. use the same images for val and test.

Thanks in advance,
Stefan

Hi @stefan.hauenstein, trainval.txt should just be the combination of both train.txt and val.txt (all of the images from train.txt and all of the images from val.txt)

Ideally, for a real production-quality model, you would not want to overlap val and test sets, as the test set is not supposed to be used at all during the training process. The val set isn’t trained on directly, but it is used to guide the hyperparameters (such as learning rate) during training.

Just for quick prototyping of a model, I even use all images in each set (replicating train/val/test so they all use all the images). While you have to collect less images that way, it certainly isn’t a best practice to follow for making ‘real’ models.

1 Like

Hi @dusty_nv, thank you for your detailed answer…