Spaces:
Runtime error
Runtime error
tomaseo2022
commited on
Commit
Β·
6b3f326
1
Parent(s):
c5d03b7
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,9 @@ from rembg import remove
|
|
15 |
def remove_background(img):
|
16 |
img = Image.open(img)
|
17 |
img = rembg.remove(img)
|
18 |
-
|
|
|
|
|
19 |
|
20 |
def inference(img):
|
21 |
output = remove_background(img)
|
@@ -27,6 +29,11 @@ def inference(img):
|
|
27 |
cv2.drawContours(silhouette, contours, -1, (255, 255, 255), 1)
|
28 |
return silhouette
|
29 |
|
|
|
|
|
|
|
|
|
|
|
30 |
gr.Interface(
|
31 |
inference,
|
32 |
gr.inputs.Image(type="filepath", label="Input"),
|
|
|
15 |
def remove_background(img):
|
16 |
img = Image.open(img)
|
17 |
img = rembg.remove(img)
|
18 |
+
output = remove(input_img[:, :, [2,1,0]])
|
19 |
+
return output
|
20 |
+
|
21 |
|
22 |
def inference(img):
|
23 |
output = remove_background(img)
|
|
|
29 |
cv2.drawContours(silhouette, contours, -1, (255, 255, 255), 1)
|
30 |
return silhouette
|
31 |
|
32 |
+
|
33 |
+
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
gr.Interface(
|
38 |
inference,
|
39 |
gr.inputs.Image(type="filepath", label="Input"),
|