Update app.py
Browse files
app.py
CHANGED
|
@@ -33,7 +33,7 @@ def find_result_image(path):
|
|
| 33 |
return None
|
| 34 |
|
| 35 |
# --- 2. Main Processing Function (UPDATED for multi-bbox drawing) ---
|
| 36 |
-
def process_ocr_task(image, model_size, task_type
|
| 37 |
"""
|
| 38 |
Processes an image with DeepSeek-OCR for all supported tasks.
|
| 39 |
Now draws ALL detected bounding boxes for ANY task.
|
|
@@ -119,7 +119,7 @@ with gr.Blocks(title="DeepSeek-OCR X (t)", theme=gr.themes.Soft()) as demo:
|
|
| 119 |
output_text = gr.Textbox(label="📄 Text Result", lines=15, show_copy_button=True)
|
| 120 |
output_image = gr.Image(label="🖼️ Image Result (if any)", type="pil")
|
| 121 |
|
| 122 |
-
submit_btn.click(fn=process_ocr_task, inputs=[image_input, model_size, task_type
|
| 123 |
|
| 124 |
# --- 4. Launch the App ---
|
| 125 |
if __name__ == "__main__":
|
|
|
|
| 33 |
return None
|
| 34 |
|
| 35 |
# --- 2. Main Processing Function (UPDATED for multi-bbox drawing) ---
|
| 36 |
+
def process_ocr_task(image, model_size, task_type):
|
| 37 |
"""
|
| 38 |
Processes an image with DeepSeek-OCR for all supported tasks.
|
| 39 |
Now draws ALL detected bounding boxes for ANY task.
|
|
|
|
| 119 |
output_text = gr.Textbox(label="📄 Text Result", lines=15, show_copy_button=True)
|
| 120 |
output_image = gr.Image(label="🖼️ Image Result (if any)", type="pil")
|
| 121 |
|
| 122 |
+
submit_btn.click(fn=process_ocr_task, inputs=[image_input, model_size, task_type], outputs=[output_text, output_image])
|
| 123 |
|
| 124 |
# --- 4. Launch the App ---
|
| 125 |
if __name__ == "__main__":
|