Spaces:
Running
Running
fix: got_ocr
Browse files- app.py +1 -1
- got_ocr.py +1 -1
app.py
CHANGED
@@ -124,7 +124,7 @@ with gr.Blocks() as demo:
|
|
124 |
task_dropdown = gr.Dropdown(
|
125 |
choices=["plain texts OCR", "format texts OCR", "plain multi-crop OCR", "format multi-crop OCR", "plain fine-grained OCR", "format fine-grained OCR"],
|
126 |
label="选择GOT模式",
|
127 |
-
value="
|
128 |
)
|
129 |
fine_grained_dropdown = gr.Dropdown(choices=["box", "color"], label="fine-grained类型", visible=False)
|
130 |
color_dropdown = gr.Dropdown(choices=["red", "green", "blue"], label="颜色列表", visible=False)
|
|
|
124 |
task_dropdown = gr.Dropdown(
|
125 |
choices=["plain texts OCR", "format texts OCR", "plain multi-crop OCR", "format multi-crop OCR", "plain fine-grained OCR", "format fine-grained OCR"],
|
126 |
label="选择GOT模式",
|
127 |
+
value="format texts OCR",
|
128 |
)
|
129 |
fine_grained_dropdown = gr.Dropdown(choices=["box", "color"], label="fine-grained类型", visible=False)
|
130 |
color_dropdown = gr.Dropdown(choices=["red", "green", "blue"], label="颜色列表", visible=False)
|
got_ocr.py
CHANGED
@@ -2,7 +2,7 @@ import base64
|
|
2 |
import os
|
3 |
|
4 |
|
5 |
-
def got_ocr(model, tokenizer, image_path, got_mode="
|
6 |
# 执行OCR
|
7 |
try:
|
8 |
if got_mode == "plain texts OCR":
|
|
|
2 |
import os
|
3 |
|
4 |
|
5 |
+
def got_ocr(model, tokenizer, image_path, got_mode="format texts OCR", fine_grained_mode="", ocr_color="", ocr_box=""):
|
6 |
# 执行OCR
|
7 |
try:
|
8 |
if got_mode == "plain texts OCR":
|