File size: 388 Bytes
7e0cd5c
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import numpy as np
import cv2


img = plt.imread('../example/fill-anything/sample1.png')
fig, ax = plt.subplots(1)
ax.imshow(img)

x1, y1, x2, y2 = 230, 283, 352, 407
rect = patches.Rectangle((x1, y1), x2-x1, y2-y1, linewidth=2, edgecolor='r', facecolor='none')
ax.add_patch(rect)
plt.savefig('bbox.png')