简体   繁体   中英

Changing Bounding Box Label Format

I was looking for an online service that allow me to annotate images with bounding boxes, I found labelbox , but there bounding box label format is different than the format that I need which is yolo.

This is there format: "bbox": { "top": 186, "left": 192, "height": 300, "width": 519 } .

The format that i need is x_center y_center width height , also the values needs to be between 0 and 1

bbox = {"top": 186, "left": 192,  "height": 300, "width": 519}

y1 = bbox["top"]
x1 = bbox["left"]
height = bbox["height"]
width = bbox["width"]

x2 = x1+width
y2 = y1+height

x_center = round((x1+x2)/2)
y_center = round((y1+y2)/2)

bbox_list = [x_center, y_center, width, height]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM