Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wrong annotation: class_id = 1. But class_id should be [from 0 to 0], file: data/obj/20210221_112744.txt

Tags:

python

yolo

I am using Yolo to train custom object detection while training i am getting following error

   Wrong annotation: class_id = 1. But class_id should be [from 0 to 0], file: data/obj/20210221_112732.txt 

1 Answers

Here's a review of the YOLO label format:

<class id> <Xo/X> <Yo/Y> <W/X> <H/Y>

Where:

<class id>, label index of the class, integer object number from 0 to (classes-1)

<Xo/X> coordinate of the bounding box’s center

<Yo/Y> coordinate of the bounding box’s center

W, Width of the bounding box

H, Height of the bounding box

X, Width of the image

Y, Height of the image

It seems like you have put classes=1 in your data file. That means your class id should be 0 in the labels. Edit the class id in your labels to 0.

like image 64
Addie Ira B. Parico Avatar answered Sep 19 '25 21:09

Addie Ira B. Parico