Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import numpy as np
|
|
4 |
|
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
|
@@ -23,7 +23,7 @@ def inference(img,v1,v2):
|
|
23 |
#out = cv2.adaptiveThreshold(gray,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY,333,3)
|
24 |
out = cv2.GaussianBlur( gray ,(5,5),0)
|
25 |
# v1 121 , v2 1
|
26 |
-
out = cv2.adaptiveThreshold( out ,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY,
|
27 |
#out = cv2.dilate(out,(5,5))
|
28 |
#out = blur = cv.GaussianBlur(img,(5,5),0)
|
29 |
#out = cv2.threshold(out,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
|
|
|
4 |
|
5 |
|
6 |
|
7 |
+
def inference(img, num_inference_steps_slider_component_v1 : int , num_inference_steps_slider_component_v2 : int ):
|
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
|
|
|
23 |
#out = cv2.adaptiveThreshold(gray,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY,333,3)
|
24 |
out = cv2.GaussianBlur( gray ,(5,5),0)
|
25 |
# v1 121 , v2 1
|
26 |
+
out = cv2.adaptiveThreshold( out ,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, num_inference_steps_slider_component_v1 , num_inference_steps_slider_component_v2 )
|
27 |
#out = cv2.dilate(out,(5,5))
|
28 |
#out = blur = cv.GaussianBlur(img,(5,5),0)
|
29 |
#out = cv2.threshold(out,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
|