AlexeyAB / Yolo_mark

GUI for marking bounded boxes of objects in images for training neural network Yolo v3 and v2

Home Page:https://github.com/AlexeyAB/darknet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

jamessmith90 opened this issue · comments

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.

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