Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,12 +11,12 @@ 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 |
-
processed = morphology.remove_small_objects(grayscale
|
15 |
#out = processed
|
16 |
|
17 |
# black out pixels
|
18 |
-
mask_x, mask_y = np.where(processed == 0)
|
19 |
-
img[mask_x, mask_y, :3] = 0
|
20 |
#mask_x, mask_y = np.where(processed == 0)
|
21 |
#im[mask_x, mask_y, :3] = 0
|
22 |
|
|
|
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 |
+
processed = morphology.remove_small_objects(grayscale , min_size=2, connectivity=4)
|
15 |
#out = processed
|
16 |
|
17 |
# black out pixels
|
18 |
+
#mask_x, mask_y = np.where(processed == 0)
|
19 |
+
#img[mask_x, mask_y, :3] = 0
|
20 |
#mask_x, mask_y = np.where(processed == 0)
|
21 |
#im[mask_x, mask_y, :3] = 0
|
22 |
|