Spaces:
Runtime error
Runtime error
adding cache
Browse files
app.py
CHANGED
|
@@ -190,17 +190,6 @@ def process_with_status(image):
|
|
| 190 |
def create_interface():
|
| 191 |
"""Create the Gradio interface with proper configuration."""
|
| 192 |
|
| 193 |
-
# Example images from assets
|
| 194 |
-
example_images = []
|
| 195 |
-
assets_dir = "assets"
|
| 196 |
-
if os.path.exists(assets_dir):
|
| 197 |
-
for file in os.listdir(assets_dir):
|
| 198 |
-
if file.lower().endswith(('.png', '.jpg', '.jpeg')):
|
| 199 |
-
example_images.append([os.path.join(assets_dir, file)])
|
| 200 |
-
|
| 201 |
-
# If no example images found, use empty list
|
| 202 |
-
if not example_images:
|
| 203 |
-
example_images = []
|
| 204 |
|
| 205 |
with gr.Blocks(
|
| 206 |
title="AtlasOCR - Darija Document OCR",
|
|
@@ -225,16 +214,6 @@ def create_interface():
|
|
| 225 |
label="Upload Image",
|
| 226 |
height=400
|
| 227 |
)
|
| 228 |
-
|
| 229 |
-
# Example gallery
|
| 230 |
-
if example_images:
|
| 231 |
-
gr.Examples(
|
| 232 |
-
examples=example_images,
|
| 233 |
-
inputs=image_input,
|
| 234 |
-
label="Example Images",
|
| 235 |
-
examples_per_page=4
|
| 236 |
-
)
|
| 237 |
-
|
| 238 |
# Submit button
|
| 239 |
submit_btn = gr.Button(
|
| 240 |
"Extract Text",
|
|
|
|
| 190 |
def create_interface():
|
| 191 |
"""Create the Gradio interface with proper configuration."""
|
| 192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
|
| 194 |
with gr.Blocks(
|
| 195 |
title="AtlasOCR - Darija Document OCR",
|
|
|
|
| 214 |
label="Upload Image",
|
| 215 |
height=400
|
| 216 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 217 |
# Submit button
|
| 218 |
submit_btn = gr.Button(
|
| 219 |
"Extract Text",
|