Spaces:
Runtime error
Runtime error
Commit
•
fa4830b
1
Parent(s):
c70b9f2
Update app.py
Browse files
app.py
CHANGED
@@ -21,12 +21,12 @@ def midpoint(x1, y1, x2, y2):
|
|
21 |
return (x_mid, y_mid)
|
22 |
|
23 |
def draw_boxes(img, bounds, color='yellow', width=2):
|
24 |
-
mask = np.zeros(img.shape[:2], dtype="uint8")
|
25 |
for bound in bounds:
|
26 |
pts = np.array([bound[0]], np.int32)
|
27 |
-
pts = pts.reshape((-1,1,2))
|
28 |
cv.fillPoly(mask, pts, color =(255,255,255))
|
29 |
-
|
|
|
30 |
|
31 |
def draw_mask(img, bounds):
|
32 |
mask = np.zeros(img.shape[:2], dtype="uint8")
|
|
|
21 |
return (x_mid, y_mid)
|
22 |
|
23 |
def draw_boxes(img, bounds, color='yellow', width=2):
|
24 |
+
mask = np.zeros((img.shape[:2]), dtype="uint8")
|
25 |
for bound in bounds:
|
26 |
pts = np.array([bound[0]], np.int32)
|
|
|
27 |
cv.fillPoly(mask, pts, color =(255,255,255))
|
28 |
+
img = cv.inpaint(img, mask, 1, cv.INPAINT_NS)
|
29 |
+
return(img)
|
30 |
|
31 |
def draw_mask(img, bounds):
|
32 |
mask = np.zeros(img.shape[:2], dtype="uint8")
|