hmarzan commited on
Commit
4411475
1 Parent(s): 4e890c0

Changed gradio layout to default

Browse files
Files changed (1) hide show
  1. app.py +9 -15
app.py CHANGED
@@ -36,18 +36,12 @@ def predict_matricula(model, task_name, image):
36
 
37
  import gradio as gr
38
 
39
- with gr.Blocks() as demo:
40
- fn_predict=lambda x:predict_matricula(model, task_name="matricula", image=x)
41
- gr.Markdown(
42
- """
43
- # Demo: Donut 🍩 for DR Matriculas
44
- Dominican Vehicle **Matriculas OCR** Infering
45
- """)
46
- with gr.Row():
47
- input_image=gr.Image(label="Matricula", sources="upload", type="pil", show_label=True)
48
- with gr.Row():
49
- output_json=gr.JSON(label="Matricula JSON", show_label=True, value={})
50
- submit_btn = gr.Button("Submit")
51
- submit_btn.click(fn=fn_predict, inputs=[input_image], outputs=[output_json])
52
-
53
- demo.launch(share=True)
 
36
 
37
  import gradio as gr
38
 
39
+ demo = gr.Interface(
40
+ fn=lambda x:predict_matricula(model, task_name="matricula", image=x),
41
+ title="Demo: Donut 🍩 for DR Matriculas",
42
+ description="Dominican Vehicle **Matriculas OCR** Infering",
43
+ inputs=gr.Image(label="Matricula", sources="upload", type="pil", show_label=True),
44
+ outputs=[gr.JSON(label="Matricula JSON", show_label=True, value={})]
45
+ )
46
+
47
+ demo.launch(share=True)