tomaseo2022 commited on
Commit
988ed53
Β·
1 Parent(s): 8f8598a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -20,14 +20,8 @@ def inference(img):
20
  contours, _ = cv2.findContours(edges, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
21
  silhouette = np.zeros_like(img)
22
  result = cv2.drawContours(silhouette, contours, -1, (255, 255, 255), 1)
23
- return result
24
-
25
- def remove_background(img):
26
- img = rembg.remove(img)
27
- return img
28
-
29
- result = inference(img)
30
- output = remove_background(result)
31
 
32
 
33
  gr.Interface(
 
20
  contours, _ = cv2.findContours(edges, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
21
  silhouette = np.zeros_like(img)
22
  result = cv2.drawContours(silhouette, contours, -1, (255, 255, 255), 1)
23
+ output = remove_background(result)
24
+ return output
 
 
 
 
 
 
25
 
26
 
27
  gr.Interface(