how to use the images contains no objects?
In my setting, there are some images contain some persons and some images no persons(background images). how can i use all of them for training the yolo? Should I add empty txt files for the background images?
Should I add empty txt files for the background images?
Yes.
https://github.com/AlexeyAB/darknet#how-to-improve-object-detection
desirable that your training dataset include images with non-labeled objects that you do not want to detect - negative samples without bounded box (empty .txt files) - use as many images of negative samples as there are images with objects
Should i give background images as an another class? For example, if i want to detect cars, i should have a bunch of images with car with label 1. But when i add background images, should i create only empty file and configure my yolo_voc.cfg file's class value as a 1 or 2?
For example; because of i have 1 class, my file consists; classes=1 and filters=30. But did i do classes=2 and filters=35. (i'm talking about Yolov2)
Thank you @AlexeyAB
Should i give background images as an another class? For example, if i want to detect cars, i should have a bunch of images with car with label 1. But when i add background images, should i create only empty file and configure my yolo_voc.cfg file's class value as a 1 or 2?
For example; because of i have 1 class, my file consists; classes=1 and filters=30. But did i do classes=2 and filters=35. (i'm talking about Yolov2)
Thank you @AlexeyAB
how did you deal with it? I also met this problem.
Do we have to add the negative image paths to the train.txt file?
Do we have to add the negative image paths to the
train.txtfile?
Yes, you are supposed to add it to your train.txt
How does yolo use these empty labels to calculate loss? One told me that these empty labels will be coded as a point [0,0,0,0,1] in background. But I`m confused about that.
Dear all, can the negative images be added to both train.txt and valid.txt? Thanks!
Dear all, can the negative images be added to both train.txt and valid.txt? Thanks!
yes. that's what i do.