Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,8 @@ import numpy as np
|
|
5 |
|
6 |
|
7 |
def inference(img):
|
8 |
-
out = cv2.erode(img,(15,15))
|
9 |
-
out = cv2.dilate(out,(55,55))
|
10 |
# https://scikit-image.org/docs/dev/api/skimage.morphology.html#skimage.morphology.remove_small_objects
|
11 |
# my_result = cv2.remove_small_objects(binarized.astype(bool), min_size=2, connectivity=2).astype(int)
|
12 |
|
@@ -18,6 +18,10 @@ def inference(img):
|
|
18 |
#mask = np.dstack([mask, mask, mask]) / 255
|
19 |
#out = img * mask
|
20 |
|
|
|
|
|
|
|
|
|
21 |
return out
|
22 |
|
23 |
# For information on Interfaces, head to https://gradio.app/docs/
|
|
|
5 |
|
6 |
|
7 |
def inference(img):
|
8 |
+
#out = cv2.erode(img,(15,15))
|
9 |
+
#out = cv2.dilate(out,(55,55))
|
10 |
# https://scikit-image.org/docs/dev/api/skimage.morphology.html#skimage.morphology.remove_small_objects
|
11 |
# my_result = cv2.remove_small_objects(binarized.astype(bool), min_size=2, connectivity=2).astype(int)
|
12 |
|
|
|
18 |
#mask = np.dstack([mask, mask, mask]) / 255
|
19 |
#out = img * mask
|
20 |
|
21 |
+
out = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY )
|
22 |
+
#kernel = cv2.getStructuringElement(cv2.MORPH_RECT, kernelSize)
|
23 |
+
#opening = cv2.morphologyEx(gray, cv2.MORPH_OPEN, kernel)
|
24 |
+
|
25 |
return out
|
26 |
|
27 |
# For information on Interfaces, head to https://gradio.app/docs/
|