Update app.py
Browse files
app.py
CHANGED
|
@@ -109,12 +109,13 @@ def process_file(file):
|
|
| 109 |
all_crops.append(crop)
|
| 110 |
return all_crops if all_crops else [Image.new("RGB", (300, 100), color=(255, 0, 0))]
|
| 111 |
|
|
|
|
| 112 |
demo = gr.Interface(
|
| 113 |
fn=process_file,
|
| 114 |
-
inputs=gr.File(label="
|
| 115 |
-
outputs=gr.Gallery(label="
|
| 116 |
-
title="
|
| 117 |
-
description="
|
| 118 |
)
|
| 119 |
|
| 120 |
demo.launch()
|
|
|
|
| 109 |
all_crops.append(crop)
|
| 110 |
return all_crops if all_crops else [Image.new("RGB", (300, 100), color=(255, 0, 0))]
|
| 111 |
|
| 112 |
+
# English Gradio Interface
|
| 113 |
demo = gr.Interface(
|
| 114 |
fn=process_file,
|
| 115 |
+
inputs=gr.File(label="Upload a PDF or image", file_types=[".pdf", ".jpg", ".png"]),
|
| 116 |
+
outputs=gr.Gallery(label="Detected Images", columns=3, height="auto", object_fit="contain"),
|
| 117 |
+
title="Embedded Image Extractor",
|
| 118 |
+
description="Extracts only the image regions from scanned documents, filtering out areas with significant text content."
|
| 119 |
)
|
| 120 |
|
| 121 |
demo.launch()
|