emilios commited on
Commit
78f92ee
·
verified ·
1 Parent(s): ae5f541

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -5,7 +5,7 @@ import numpy as np
5
  #num_inference_steps_slider_component_v1 = 121
6
  #num_inference_steps_slider_component_v2 = 3
7
 
8
- def inference(img, v1 = "121" , v2 = "9" ):
9
  #out = cv2.erode(img,(15,15))
10
  #out = cv2.dilate(out,(55,55))
11
  # https://scikit-image.org/docs/dev/api/skimage.morphology.html#skimage.morphology.remove_small_objects
@@ -25,7 +25,7 @@ def inference(img, v1 = "121" , v2 = "9" ):
25
  out = cv2.GaussianBlur( gray ,(5,5),0)
26
  # v1 121 , v2 1
27
  #out = cv2.adaptiveThreshold( out ,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, int( float(v1) ) , int( float(v2) ) )
28
- out = cv2.adaptiveThreshold( out ,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 121, 9 )
29
  #out = cv2.dilate(out,(5,5))
30
  #out = blur = cv.GaussianBlur(img,(5,5),0)
31
  #out = cv2.threshold(out,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
 
5
  #num_inference_steps_slider_component_v1 = 121
6
  #num_inference_steps_slider_component_v2 = 3
7
 
8
+ def inference(img, v1 = "121" , v2 = 9 ):
9
  #out = cv2.erode(img,(15,15))
10
  #out = cv2.dilate(out,(55,55))
11
  # https://scikit-image.org/docs/dev/api/skimage.morphology.html#skimage.morphology.remove_small_objects
 
25
  out = cv2.GaussianBlur( gray ,(5,5),0)
26
  # v1 121 , v2 1
27
  #out = cv2.adaptiveThreshold( out ,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, int( float(v1) ) , int( float(v2) ) )
28
+ out = cv2.adaptiveThreshold( out ,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 77 , v2 )
29
  #out = cv2.dilate(out,(5,5))
30
  #out = blur = cv.GaussianBlur(img,(5,5),0)
31
  #out = cv2.threshold(out,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)