【问题标题】:Changing Bounding Box Label Format更改边界框标签格式
【发布时间】:2020-12-17 21:05:23
【问题描述】:

我正在寻找一种允许我使用边界框注释图像的在线服务,我找到了labelbox,但边界框标签格式与我需要的格式不同,即 yolo。

这是格式:"bbox": { "top": 186, "left": 192, "height": 300, "width": 519 }

我需要的格式是x_center y_center width height,值也需要在0到1之间

【问题讨论】:

    标签: python computer-vision object-detection yolo bounding-box


    【解决方案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]
    

    【讨论】:

    • @Mohammed Aljahdali 如果解决方案有帮助,您能接受它作为解决方案吗?
    猜你喜欢
    • 2021-05-19
    • 2011-02-22
    • 1970-01-01
    • 1970-01-01
    • 2020-08-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-02
    相关资源
    最近更新 更多