emilios commited on
Commit
dd1c3e6
·
verified ·
1 Parent(s): 87a0c8f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -14,7 +14,7 @@ from skimage.morphology import closing, square, disk
14
 
15
 
16
  def inference(img):
17
- out = skimage.color.rgb2gray(img) # gray
18
  #binarized = np.where(grayscale>0.1, 1, 0)
19
  #processed = morphology.remove_small_objects(grayscale.astype(bool), min_size=33, connectivity=4).astype(int)
20
 
@@ -36,9 +36,9 @@ def inference(img):
36
 
37
  #denoise = restoration.denoise_tv_chambolle( out , weight=0.1)
38
  #thresh = threshold_otsu(denoise)
39
- thresh = threshold_otsu(out)
40
  #out = closing(denoise > thresh, square(2))
41
- out = out > thresh
42
 
43
 
44
  return out
 
14
 
15
 
16
  def inference(img):
17
+ gray = skimage.color.rgb2gray(img) # gray
18
  #binarized = np.where(grayscale>0.1, 1, 0)
19
  #processed = morphology.remove_small_objects(grayscale.astype(bool), min_size=33, connectivity=4).astype(int)
20
 
 
36
 
37
  #denoise = restoration.denoise_tv_chambolle( out , weight=0.1)
38
  #thresh = threshold_otsu(denoise)
39
+ thresh = threshold_otsu(gray)
40
  #out = closing(denoise > thresh, square(2))
41
+ out = gray > thresh
42
 
43
 
44
  return out