emilios commited on
Commit
37e4718
·
verified ·
1 Parent(s): a6c2406

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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(binarized.astype(bool), min_size=33, connectivity=4).astype(int)
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 binarized
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/