AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.64k stars 7.95k forks source link

Yolo and Dataset format #1089

Open holak0 opened 6 years ago

holak0 commented 6 years ago

Hi,

I want to train Yolo with the Vedai dataset (https://downloads.greyc.fr/vedai/), when I downloaded the dataset I get annotation files like this : problem

Can please someone tell me what this annotation format and how I can convert it to Yolo format.

Thank you

holak0 commented 6 years ago

Can someone please respond me ....Thank you

TheMikeyR commented 6 years ago

@holak0 this have nothing to do with this repository that you can't get another dataset to work.

If you wanted to invest 2 minutes into looking at the paper they released with the dataset you can find the format at page 15-16

Table 4: Exerpt from the annotation file. This file contains, for each target and from left to right (one target per line), the image ID, the coordinates of the center in the image, the orientation of the vehicle, the 4 coordinates of the 4 corners, the class name, a flag stating if the target is entirely contained in the image, a flag stating if the vehicle is occluded.

It's not the community's job to do your work for you, so please don't hurry people to respond.

holak0 commented 6 years ago

Hi @TheMikeyR,

First thank you for your response I have already read the article and I know what the file contain, the problem I don't know what this format ??? because if I know the format I will know how to convert it in the Yolo format... and Im sorry because Iam just a newbie.

holak0 commented 6 years ago

Thank you I have found a solution.

TheMikeyR commented 6 years ago

No problem, I don't understand what your question is, but I'm glad you figured out a solution.

To describe their annotation so it should be possible to convert it.

Filename 00000000.txt

290.348971 504.611640 3.012318 2 1 0 277 303 304 279 502 498 508 511

290.348971 504.611640 The coordinates of the center of the vehicle in the image,

3.012318 Orientation of the vehicle (the angle it makes with the horizontal line, modulo π or 2π)

2 1 0 Class name, flag stating if the taget is entirely inside the image, flag stating if the vehicle is occluded

277 303 304 279 502 498 508 511 4 corners, so I assume it is paired (277, 303), (304, 279), (502, 498), (508, 511) I don't know how they are paired if it is, x1,x2,x3,x4,y1,y2,y3,y4 or x1,y1,x2,y2,x3,y3,x4,y4 or other. But take the image and plot the coordinates and it should be easy to figure out how they are paired.

What do you need? You need class name, center of object and the 4 corners. From that it should be possible to convert it to yolo format, by finding the width and height of the object using the corners and then save the x, y center together with width and height. You don't need the orientation since yolo doesn't support it.

Not sure if this was related to your question but if other people find this issue it might help them.