prithivMLmods commited on
Commit
14d2a85
·
verified ·
1 Parent(s): 410ca82

update app

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -219,13 +219,14 @@ def process_ocr_task(image, model_size, task_type, ref_text):
219
 
220
  return text_result, result_image_pil
221
 
 
 
222
 
223
- # --- 3. Build the Gradio Interface ---
224
  with gr.Blocks(css=css, theme=steel_blue_theme) as demo:
225
  gr.Markdown("# **DeepSeek OCR [exp]**", elem_id="main-title")
226
  with gr.Row():
227
  with gr.Column(scale=1):
228
- image_input = gr.Image(type="pil", label="Upload Image", sources=["upload", "clipboard"])
229
  model_size = gr.Dropdown(choices=["Tiny", "Small", "Base", "Large", "Gundam (Recommended)"], value="Large", label="Resolution Size")
230
  task_type = gr.Dropdown(choices=["Free OCR", "Convert to Markdown", "Parse Figure", "Locate Object by Reference"], value="Convert to Markdown", label="Task Type")
231
  ref_text_input = gr.Textbox(label="Reference Text (for Locate task)", placeholder="e.g., the teacher, 20-10, a red car...", visible=False)
 
219
 
220
  return text_result, result_image_pil
221
 
222
+ url = "https://huggingface.co/spaces/prithivMLmods/Multimodal-OCR3/resolve/main/examples/2.jpg?download=true"
223
+ example_image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
224
 
 
225
  with gr.Blocks(css=css, theme=steel_blue_theme) as demo:
226
  gr.Markdown("# **DeepSeek OCR [exp]**", elem_id="main-title")
227
  with gr.Row():
228
  with gr.Column(scale=1):
229
+ image_input = gr.Image(type="pil", label="Upload Image", sources=["upload", "clipboard"],value=example_image)
230
  model_size = gr.Dropdown(choices=["Tiny", "Small", "Base", "Large", "Gundam (Recommended)"], value="Large", label="Resolution Size")
231
  task_type = gr.Dropdown(choices=["Free OCR", "Convert to Markdown", "Parse Figure", "Locate Object by Reference"], value="Convert to Markdown", label="Task Type")
232
  ref_text_input = gr.Textbox(label="Reference Text (for Locate task)", placeholder="e.g., the teacher, 20-10, a red car...", visible=False)