Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,8 @@ def inference(img, v1 = "121" , v2 = "9" ):
|
|
24 |
#out = cv2.adaptiveThreshold(gray,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY,333,3)
|
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.dilate(out,(5,5))
|
29 |
#out = blur = cv.GaussianBlur(img,(5,5),0)
|
30 |
#out = cv2.threshold(out,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
|
@@ -60,7 +61,7 @@ value=3,
|
|
60 |
# For Spaces usage, head to https://huggingface.co/docs/hub/spaces
|
61 |
iface = gradio.Interface(
|
62 |
fn=inference,
|
63 |
-
inputs=[
|
64 |
outputs='image',
|
65 |
title='Noise Removal',
|
66 |
description='Remove Noise with OpenCV and Adaptial Gaussian!',
|
|
|
24 |
#out = cv2.adaptiveThreshold(gray,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY,333,3)
|
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)
|
|
|
61 |
# For Spaces usage, head to https://huggingface.co/docs/hub/spaces
|
62 |
iface = gradio.Interface(
|
63 |
fn=inference,
|
64 |
+
inputs=['image',num_inference_steps_slider_component_v1,num_inference_steps_slider_component_v2],
|
65 |
outputs='image',
|
66 |
title='Noise Removal',
|
67 |
description='Remove Noise with OpenCV and Adaptial Gaussian!',
|