计算YOLOv4坐标绘制错误注释

问题描述

我一直在尝试为 YOlov4 编写正确的注释。我被告知需要相对于画布图像计算注释。但是存在边界框错位的问题。

enter image description here

enter image description here

这是我的函数,用于计算画布图像上每个徽标的注释:

def get_annotation_coordinates(canvas_shape,logo_shape):
    x = (logo_width + canvas_width) / 2
    y = (logo_height + canvas_height) / 2

    width = logo_width / canvas_width
    height = logo_height / canvas_height

    return f"{x / canvas_width} {y / canvas_height} {width} {height}"

我到底做错了什么?因为显然我的计算是错误的。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)