Spaces:
Runtime error
Runtime error
Commit
Β·
c5d03b7
1
Parent(s):
50e4934
Update app.py
Browse files
app.py
CHANGED
@@ -19,6 +19,7 @@ def remove_background(img):
|
|
19 |
|
20 |
def inference(img):
|
21 |
output = remove_background(img)
|
|
|
22 |
gray = cv2.cvtColor(output, cv2.COLOR_BGR2GRAY)
|
23 |
edges = cv2.Canny(gray, 50, 150)
|
24 |
contours, _ = cv2.findContours(edges, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
|
|
|
19 |
|
20 |
def inference(img):
|
21 |
output = remove_background(img)
|
22 |
+
output = np.array(output)
|
23 |
gray = cv2.cvtColor(output, cv2.COLOR_BGR2GRAY)
|
24 |
edges = cv2.Canny(gray, 50, 150)
|
25 |
contours, _ = cv2.findContours(edges, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
|