Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -208,16 +208,13 @@ def process_ocr_task(image, model_size, task_type, ref_text):
|
|
| 208 |
|
| 209 |
return text_result, result_image_pil
|
| 210 |
|
| 211 |
-
url = "https://huggingface.co/spaces/prithivMLmods/Multimodal-OCR3/resolve/main/examples/2.jpg?download=true"
|
| 212 |
-
example_image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
|
| 213 |
-
|
| 214 |
with gr.Blocks(css=css, theme=steel_blue_theme) as demo:
|
| 215 |
gr.Markdown("# **DeepSeek OCR [exp]**", elem_id="main-title")
|
| 216 |
|
| 217 |
|
| 218 |
with gr.Row():
|
| 219 |
with gr.Column(scale=1):
|
| 220 |
-
image_input = gr.Image(type="pil", label="Upload Image", sources=["upload", "clipboard"]
|
| 221 |
model_size = gr.Dropdown(choices=["Tiny", "Small", "Base", "Large", "Gundam (Recommended)"], value="Large", label="Resolution Size")
|
| 222 |
task_type = gr.Dropdown(choices=["Free OCR", "Convert to Markdown", "Parse Figure", "Locate Object by Reference"], value="Convert to Markdown", label="Task Type")
|
| 223 |
ref_text_input = gr.Textbox(label="Reference Text (for Locate task)", placeholder="e.g., the teacher, 20-10, a red car...", visible=False)
|
|
|
|
| 208 |
|
| 209 |
return text_result, result_image_pil
|
| 210 |
|
|
|
|
|
|
|
|
|
|
| 211 |
with gr.Blocks(css=css, theme=steel_blue_theme) as demo:
|
| 212 |
gr.Markdown("# **DeepSeek OCR [exp]**", elem_id="main-title")
|
| 213 |
|
| 214 |
|
| 215 |
with gr.Row():
|
| 216 |
with gr.Column(scale=1):
|
| 217 |
+
image_input = gr.Image(type="pil", label="Upload Image", sources=["upload", "clipboard"])
|
| 218 |
model_size = gr.Dropdown(choices=["Tiny", "Small", "Base", "Large", "Gundam (Recommended)"], value="Large", label="Resolution Size")
|
| 219 |
task_type = gr.Dropdown(choices=["Free OCR", "Convert to Markdown", "Parse Figure", "Locate Object by Reference"], value="Convert to Markdown", label="Task Type")
|
| 220 |
ref_text_input = gr.Textbox(label="Reference Text (for Locate task)", placeholder="e.g., the teacher, 20-10, a red car...", visible=False)
|