有没有一种方法可以自动创建地面真相边界框

问题描述

我有一个数据集,我正在其中检查内部人员是否戴着口罩。我想可视化地面真值边界框,通过查找图像的借条来评估模型性能。为此,我需要绘制地面真相边界框。到目前为止,我只找到了一种手动绘制边界框的方法。有没有一种算法可以自动绘制地面真值边界框。

from d2l import mxnet as d2l
from mxnet import image,npx
d2l.set_figsize()
img = image.imread('face-mask-detector/dataset/with_mask/0-with-mask.jpg').asnumpy()
d2l.plt.imshow(img)

cat_bBox = [358,75,150,100]
#@save
def bBox_to_rect(bBox,color):
    """Convert bounding Box to matplotlib format."""
    # Convert the bounding Box (top-left x,top-left y,bottom-right x,# bottom-right y) format to matplotlib format: ((upper-left x,# upper-left y),width,height)
    return d2l.plt.Rectangle(
        xy=(bBox[0],bBox[1]),width=bBox[2]-bBox[0],height=bBox[3]-bBox[1],fill=False,edgecolor=color,linewidth=2)
fig = d2l.plt.imshow(img)
fig.axes.add_patch(bBox_to_rect(cat_bBox,'blue'))
d2l.plt.show()

解决方法

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

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

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