Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -149,15 +149,15 @@ with gr.Blocks(title="π³DeepSeek-OCRπ³", theme=gr.themes.Soft()) as demo:
|
|
| 149 |
|
| 150 |
with gr.Row():
|
| 151 |
with gr.Column(scale=1):
|
| 152 |
-
image_input = gr.Image(type="pil", label="
|
| 153 |
model_size = gr.Dropdown(choices=["Tiny", "Small", "Base", "Large", "Gundam (Recommended)"], value="Gundam (Recommended)", label="βοΈ Resolution Size")
|
| 154 |
task_type = gr.Dropdown(choices=["π Free OCR", "π Convert to Markdown", "π Parse Figure", "π Locate Object by Reference"], value="π Convert to Markdown", label="π Task Type")
|
| 155 |
ref_text_input = gr.Textbox(label="π Reference Text (for Locate task)", placeholder="e.g., the teacher, 20-10, a red car...", visible=False)
|
| 156 |
submit_btn = gr.Button("Process Image", variant="primary")
|
| 157 |
|
| 158 |
with gr.Column(scale=2):
|
| 159 |
-
output_text = gr.Textbox(label="
|
| 160 |
-
output_image = gr.Image(label="
|
| 161 |
|
| 162 |
# --- UI Interaction Logic ---
|
| 163 |
def toggle_ref_text_visibility(task):
|
|
|
|
| 149 |
|
| 150 |
with gr.Row():
|
| 151 |
with gr.Column(scale=1):
|
| 152 |
+
image_input = gr.Image(type="pil", label="Upload Image", sources=["upload", "clipboard"])
|
| 153 |
model_size = gr.Dropdown(choices=["Tiny", "Small", "Base", "Large", "Gundam (Recommended)"], value="Gundam (Recommended)", label="βοΈ Resolution Size")
|
| 154 |
task_type = gr.Dropdown(choices=["π Free OCR", "π Convert to Markdown", "π Parse Figure", "π Locate Object by Reference"], value="π Convert to Markdown", label="π Task Type")
|
| 155 |
ref_text_input = gr.Textbox(label="π Reference Text (for Locate task)", placeholder="e.g., the teacher, 20-10, a red car...", visible=False)
|
| 156 |
submit_btn = gr.Button("Process Image", variant="primary")
|
| 157 |
|
| 158 |
with gr.Column(scale=2):
|
| 159 |
+
output_text = gr.Textbox(label="Output(OCR)", lines=15, show_copy_button=True)
|
| 160 |
+
output_image = gr.Image(label="Layout Detection(If Any)", type="pil")
|
| 161 |
|
| 162 |
# --- UI Interaction Logic ---
|
| 163 |
def toggle_ref_text_visibility(task):
|