Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,8 @@ def inference(img):
|
|
21 |
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY ) # grayscale
|
22 |
#out = cv2.adaptiveThreshold(gray,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY,133,9)
|
23 |
out = cv2.adaptiveThreshold(gray,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY,333,3)
|
24 |
-
out = cv2.dilate(out,(5,5))
|
|
|
25 |
|
26 |
|
27 |
#kernel = cv2.getStructuringElement(cv2.MORPH_RECT, kernelSize)
|
@@ -41,4 +42,4 @@ iface = gradio.Interface(
|
|
41 |
examples=["detail_with_lines_and_noise.jpg", "lama.webp", "dT4KW.png"])
|
42 |
#examples=["detail_with_lines_and_noise.jpg", "lama.webp", "test_lines.jpg","llama.jpg", "dT4KW.png"])
|
43 |
|
44 |
-
iface.launch()
|
|
|
21 |
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY ) # grayscale
|
22 |
#out = cv2.adaptiveThreshold(gray,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY,133,9)
|
23 |
out = cv2.adaptiveThreshold(gray,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY,333,3)
|
24 |
+
#out = cv2.dilate(out,(5,5))
|
25 |
+
out = cv2.threshold(blur,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
|
26 |
|
27 |
|
28 |
#kernel = cv2.getStructuringElement(cv2.MORPH_RECT, kernelSize)
|
|
|
42 |
examples=["detail_with_lines_and_noise.jpg", "lama.webp", "dT4KW.png"])
|
43 |
#examples=["detail_with_lines_and_noise.jpg", "lama.webp", "test_lines.jpg","llama.jpg", "dT4KW.png"])
|
44 |
|
45 |
+
iface.launch()
|