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