def plot_patch(ax, patches, bbox, gt):
if gt is True:
color = 'g'
else:
color = 'r'
# Calculate Bounding Box Rectangle and plot it
width = bbox[3] - bbox[1]
height = bbox[2] - bbox[0]
rect = patches.Rectangle((bbox[1], bbox[0]), height, width, linewidth=2, edgecolor=color, facecolor='none')
ax.add_patch(rect)
评论列表
文章目录