Spaces:
Running
Running
Apply light preprocessing by default (grayscale, denoise, contrast=5) to improve OCR readability
Browse files- ui_components.py +3 -3
ui_components.py
CHANGED
|
@@ -131,19 +131,19 @@ def create_sidebar_options():
|
|
| 131 |
|
| 132 |
# Grayscale conversion
|
| 133 |
grayscale = st.checkbox("Convert to Grayscale",
|
| 134 |
-
value=
|
| 135 |
help="Convert color images to grayscale for better text recognition")
|
| 136 |
|
| 137 |
# Light denoising option
|
| 138 |
denoise = st.checkbox("Light Denoising",
|
| 139 |
-
value=
|
| 140 |
help="Apply gentle denoising to improve text clarity")
|
| 141 |
|
| 142 |
# Contrast adjustment
|
| 143 |
contrast = st.slider("Contrast Adjustment",
|
| 144 |
min_value=-20,
|
| 145 |
max_value=20,
|
| 146 |
-
value=
|
| 147 |
step=5,
|
| 148 |
help="Adjust image contrast (limited range)")
|
| 149 |
|
|
|
|
| 131 |
|
| 132 |
# Grayscale conversion
|
| 133 |
grayscale = st.checkbox("Convert to Grayscale",
|
| 134 |
+
value=True,
|
| 135 |
help="Convert color images to grayscale for better text recognition")
|
| 136 |
|
| 137 |
# Light denoising option
|
| 138 |
denoise = st.checkbox("Light Denoising",
|
| 139 |
+
value=True,
|
| 140 |
help="Apply gentle denoising to improve text clarity")
|
| 141 |
|
| 142 |
# Contrast adjustment
|
| 143 |
contrast = st.slider("Contrast Adjustment",
|
| 144 |
min_value=-20,
|
| 145 |
max_value=20,
|
| 146 |
+
value=5,
|
| 147 |
step=5,
|
| 148 |
help="Adjust image contrast (limited range)")
|
| 149 |
|