AlexeyAB / Yolo_mark

GUI for marking bounded boxes of objects in images for training neural network Yolo v3 and v2
https://github.com/AlexeyAB/darknet
The Unlicense
1.8k stars 680 forks source link

How to convert yolo format to x,y,w,h ? I need to crop images. | Sorry but its Emergency #167

Open jamessmith90 opened 4 years ago

jamessmith90 commented 4 years ago

I am in a tough situation and need to verify the dataset by cropping. Can someone post a simple function to convert yolo format to x,y,w,h so that i can crop images.

AlexeyAB commented 4 years ago

x_center = yolo_x image_width y_center = yolo_y image_height width = yolo_width image_width height = yolo_height image_height

x_left = (yolo_x - yolo_width/2) image_width y_top = (yolo_y - yolo_height/2) image_height