Spaces:
Running
on
Zero
Running
on
Zero
add images and update app.py
Browse files- .gitattributes +5 -0
- app.py +4 -4
- examples/math.png +3 -0
- examples/receipt-2.png +3 -0
- examples/receipt.jpg +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,8 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
examples/receipt.jpg filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
examples/receipt-2.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
examples/math.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
|
@@ -110,7 +110,7 @@ def process_image(image, model_size, task_type, is_eval_mode):
|
|
| 110 |
with gr.Blocks(title="DeepSeek-OCR", theme=gr.themes.Soft()) as demo:
|
| 111 |
gr.Markdown(
|
| 112 |
"""
|
| 113 |
-
# DeepSeek-OCR
|
| 114 |
|
| 115 |
Upload an image to extract text using DeepSeek-OCR model.
|
| 116 |
Supports various document types and handwriting recognition.
|
|
@@ -154,13 +154,12 @@ with gr.Blocks(title="DeepSeek-OCR", theme=gr.themes.Soft()) as demo:
|
|
| 154 |
with gr.Tabs():
|
| 155 |
with gr.TabItem("Annotated Image"):
|
| 156 |
output_image = gr.Image(
|
| 157 |
-
|
| 158 |
)
|
| 159 |
with gr.TabItem("Markdown Output"):
|
| 160 |
output_markdown = gr.Markdown(label="Markdown Formatted Result")
|
| 161 |
-
with gr.TabItem("
|
| 162 |
output_text = gr.Textbox(
|
| 163 |
-
label="OCR Result (eval_mode == True)",
|
| 164 |
lines=20,
|
| 165 |
show_copy_button=True,
|
| 166 |
interactive=False,
|
|
@@ -171,6 +170,7 @@ with gr.Blocks(title="DeepSeek-OCR", theme=gr.themes.Soft()) as demo:
|
|
| 171 |
examples=[
|
| 172 |
["examples/math.png", "Gundam (Recommended)", "Convert to Markdown"],
|
| 173 |
["examples/receipt.jpg", "Base", "Convert to Markdown"],
|
|
|
|
| 174 |
],
|
| 175 |
inputs=[image_input, model_size, task_type],
|
| 176 |
outputs=[output_image, output_markdown, output_text, eval_mode_checkbox],
|
|
|
|
| 110 |
with gr.Blocks(title="DeepSeek-OCR", theme=gr.themes.Soft()) as demo:
|
| 111 |
gr.Markdown(
|
| 112 |
"""
|
| 113 |
+
# DeepSeek-OCR Demo
|
| 114 |
|
| 115 |
Upload an image to extract text using DeepSeek-OCR model.
|
| 116 |
Supports various document types and handwriting recognition.
|
|
|
|
| 154 |
with gr.Tabs():
|
| 155 |
with gr.TabItem("Annotated Image"):
|
| 156 |
output_image = gr.Image(
|
| 157 |
+
interactive=False
|
| 158 |
)
|
| 159 |
with gr.TabItem("Markdown Output"):
|
| 160 |
output_markdown = gr.Markdown(label="Markdown Formatted Result")
|
| 161 |
+
with gr.TabItem("Text(Markdown Raw or Eval Output)"):
|
| 162 |
output_text = gr.Textbox(
|
|
|
|
| 163 |
lines=20,
|
| 164 |
show_copy_button=True,
|
| 165 |
interactive=False,
|
|
|
|
| 170 |
examples=[
|
| 171 |
["examples/math.png", "Gundam (Recommended)", "Convert to Markdown"],
|
| 172 |
["examples/receipt.jpg", "Base", "Convert to Markdown"],
|
| 173 |
+
["examples/receipt-2.png", "Base", "Convert to Markdown"],
|
| 174 |
],
|
| 175 |
inputs=[image_input, model_size, task_type],
|
| 176 |
outputs=[output_image, output_markdown, output_text, eval_mode_checkbox],
|
examples/math.png
ADDED
|
Git LFS Details
|
examples/receipt-2.png
ADDED
|
Git LFS Details
|
examples/receipt.jpg
ADDED
|
Git LFS Details
|