Open saikrishnadas opened 3 years ago
The normalized label format is described on this page, along with some examples: https://www.ccoderun.ca/programming/2019-08-18_Darknet_training_images/ (Scroll down towards the bottom.)
@stephanecharette my question is, how will we get the center_x and center_y from the x_min,x_max,y_min,y_max? The document explains the conversion of center_x / the image pixel
If the center is at (10, 10) and the width is 4, height is 4, then from the center to the left is 10 - (4/2), and from the center the right is 10 + (4/2), right? Same with top and bottom.
I strongly suggest you go back and re-read that page carefully. It explains how to get from X and Y coordinates to the normalized values. So if you reverse the process, you also can go from normalized values back to X and Y coordinates.
@stephanecharette I clearly understand what you saying but i dont have center points. I have only the top_right,bottom_right,top_left_bottom_left which is x_min,x_max,y_min,y_max in my .csv file
You're kidding, right?
If you have all those, then obviously you also have the center points. Add another column to your csv file, and do the math to find the center point. x1 + x2 / 2, same with y.
Sure
Did a little graph to help visualize the problem: (the center is at 4,4)
So once normalized, you should have:
@stephanecharette I really appreciate your effort. My image size is 1020 x 720p so, w = obj_w/1020 and h = obj_h/720 right ? or shld it be w = obj_w/480 and h = obj_h/480 as im going to train it on 480x480 yolov4 ?
w = obj_w/1020 and h = obj_h/720
Can't open label file. (This can be normal only if you use MSCOCO): data/obj/Avacado_retraining__172.txt
I get this error
@AlexeyAB @stephanecharette
I have a few annotations that is originally in .csv format. I would need to convert it to yolo darknet format inorder to train my model with yolov4. my .cvs file :
YOLO format is : object-class x y width height
where, object_class, widht, height is know from my .csv format. But finding x,y is confusing .Note that x and y are center of rectangle (are not top-left corner).
@AlexeyAB