Geewook Kim
commited on
Commit
·
0afc153
1
Parent(s):
69dc956
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ from donut import DonutModel
|
|
13 |
|
14 |
def demo_process(input_img):
|
15 |
global pretrained_model, task_prompt, task_name
|
16 |
-
input_img = Image.fromarray(input_img)
|
17 |
output = pretrained_model.inference(image=input_img, prompt=task_prompt)["predictions"][0]
|
18 |
return output
|
19 |
|
@@ -28,9 +28,9 @@ pretrained_model.eval()
|
|
28 |
|
29 |
demo = gr.Interface(
|
30 |
fn=demo_process,
|
31 |
-
inputs="
|
32 |
outputs="json",
|
33 |
title=f"Donut 🍩 demonstration for `cord-v2` task",
|
34 |
-
examples=
|
35 |
)
|
36 |
demo.launch(debug=True)
|
|
|
13 |
|
14 |
def demo_process(input_img):
|
15 |
global pretrained_model, task_prompt, task_name
|
16 |
+
# input_img = Image.fromarray(input_img)
|
17 |
output = pretrained_model.inference(image=input_img, prompt=task_prompt)["predictions"][0]
|
18 |
return output
|
19 |
|
|
|
28 |
|
29 |
demo = gr.Interface(
|
30 |
fn=demo_process,
|
31 |
+
inputs= gr.inputs.Image(type="pil"),
|
32 |
outputs="json",
|
33 |
title=f"Donut 🍩 demonstration for `cord-v2` task",
|
34 |
+
examples=[["cord_sample_receipt.jpg"]],
|
35 |
)
|
36 |
demo.launch(debug=True)
|