Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,14 +11,16 @@ def inference(img):
|
|
11 |
grayscale = skimage.color.rgb2gray(img)
|
12 |
binarized = np.where(grayscale>0.1, 1, 0)
|
13 |
processed = morphology.remove_small_objects(binarized.astype(bool), min_size=2, connectivity=2).astype(int)
|
14 |
-
out =
|
15 |
|
16 |
# black out pixels
|
|
|
|
|
17 |
#mask_x, mask_y = np.where(processed == 0)
|
18 |
#im[mask_x, mask_y, :3] = 0
|
19 |
|
20 |
|
21 |
-
return
|
22 |
|
23 |
# For information on Interfaces, head to https://gradio.app/docs/
|
24 |
# For user guides, head to https://gradio.app/guides/
|
|
|
11 |
grayscale = skimage.color.rgb2gray(img)
|
12 |
binarized = np.where(grayscale>0.1, 1, 0)
|
13 |
processed = morphology.remove_small_objects(binarized.astype(bool), min_size=2, connectivity=2).astype(int)
|
14 |
+
#out = processed
|
15 |
|
16 |
# black out pixels
|
17 |
+
mask_x, mask_y = np.where(processed == 0)
|
18 |
+
img[mask_x, mask_y, :3] = 0
|
19 |
#mask_x, mask_y = np.where(processed == 0)
|
20 |
#im[mask_x, mask_y, :3] = 0
|
21 |
|
22 |
|
23 |
+
return img
|
24 |
|
25 |
# For information on Interfaces, head to https://gradio.app/docs/
|
26 |
# For user guides, head to https://gradio.app/guides/
|