Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -10,9 +10,9 @@ model = model.eval().cuda()
|
|
10 |
|
11 |
@spaces.GPU
|
12 |
def run_GOT(image_array, got_mode, ocr_box="", ocr_color=""):
|
13 |
-
image = Image.fromarray(np.uint8(image_array))
|
14 |
if got_mode == "plain texts OCR":
|
15 |
-
res = model.chat(tokenizer, image, ocr_type='ocr', gradio_input=
|
16 |
elif got_mode == "format texts OCR":
|
17 |
res = model.chat(tokenizer, image, ocr_type='format', render=True, save_render_file='./demo.html', gradio_input=True)
|
18 |
elif got_mode == "plain multi-crop OCR":
|
|
|
10 |
|
11 |
@spaces.GPU
|
12 |
def run_GOT(image_array, got_mode, ocr_box="", ocr_color=""):
|
13 |
+
# image = Image.fromarray(np.uint8(image_array))
|
14 |
if got_mode == "plain texts OCR":
|
15 |
+
res = model.chat(tokenizer, image, ocr_type='ocr', gradio_input=False)
|
16 |
elif got_mode == "format texts OCR":
|
17 |
res = model.chat(tokenizer, image, ocr_type='format', render=True, save_render_file='./demo.html', gradio_input=True)
|
18 |
elif got_mode == "plain multi-crop OCR":
|