Spaces:
Sleeping
Sleeping
Commit
·
0bea06b
1
Parent(s):
9be54bb
Changing layout
Browse files
app.py
CHANGED
@@ -40,16 +40,17 @@ examples = [["data/receipt_00000.JPG", 7.7],
|
|
40 |
|
41 |
with gr.Blocks() as demo:
|
42 |
gr.Markdown(f"# {title}\n{description}")
|
43 |
-
|
44 |
-
|
|
|
45 |
|
46 |
-
|
47 |
|
48 |
submit_btn = gr.Button("Submit")
|
49 |
clear_btn = gr.ClearButton()
|
50 |
|
51 |
submit_btn.click(inference, inputs=[image, width_ths], outputs=ocr_out)
|
52 |
-
clear_btn.click(lambda: [None, 7.7],
|
53 |
|
54 |
examples_obj = gr.Examples(examples=examples, inputs=[image, width_ths])
|
55 |
|
|
|
40 |
|
41 |
with gr.Blocks() as demo:
|
42 |
gr.Markdown(f"# {title}\n{description}")
|
43 |
+
with gr.Row():
|
44 |
+
image = gr.Image(width=320, height=320, label="Input Receipt")
|
45 |
+
ocr_out = gr.Textbox(label="OCR Output", type="text")
|
46 |
|
47 |
+
width_ths = gr.Slider(0, 10, 7.7, 0.1, label="Width Threshold to merge bounding boxes")
|
48 |
|
49 |
submit_btn = gr.Button("Submit")
|
50 |
clear_btn = gr.ClearButton()
|
51 |
|
52 |
submit_btn.click(inference, inputs=[image, width_ths], outputs=ocr_out)
|
53 |
+
clear_btn.click(lambda: [None, 7.7], inputs=[image, width_ths])
|
54 |
|
55 |
examples_obj = gr.Examples(examples=examples, inputs=[image, width_ths])
|
56 |
|