1

If an image (abc.jpg) doesn't have any bounding box, how should look its corresponding label file (abc.txt)?

The regular label format is:

label x_center/width y_center/height width/image_width, height/image_height.
Michael D
  • 1,711
  • 4
  • 23
  • 38

1 Answers1

1

For each yolo version you should check its corresponding dataloader to see how it handles empty images. For Yolov5 I found the following: "if no objects in image, no *.txt file is required". You can find the source for this in their original documentation. Again, this may not be the case for all the other Yolo versions as there is no unified dataloader used by all of the Yolo versions

Mike B
  • 2,136
  • 2
  • 12
  • 31
  • Great! Did you find similar documentation for **Yolov7** or **Yolov8** ? Also, I was suggested by a colleague to if there is no object, to write bounding box = size of the image, with a separate class (label) for no objects. – Michael D May 16 '23 at 08:39
  • 1
    Again, there is no unified dataloader used by all Yolos. So that recommendation make no sense to me at all – Mike B May 16 '23 at 08:40
  • You are right. Now I found, that Yolov2, in such case ask to provide empty .txt file. – Michael D May 16 '23 at 08:46
  • Exactly, each implementation has to be examined individually. There is no one fits all here. – Mike B May 16 '23 at 08:48