Spaces:
Runtime error
Runtime error
Mohit Kumar
commited on
Commit
·
12b62c2
1
Parent(s):
9a2601d
Updated file
Browse files
app.py
CHANGED
@@ -1,6 +1,4 @@
|
|
1 |
import os
|
2 |
-
os.system('pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu')
|
3 |
-
|
4 |
import gradio as gr
|
5 |
import numpy as np
|
6 |
from transformers import AutoModelForTokenClassification
|
@@ -92,23 +90,15 @@ def process_image(image):
|
|
92 |
return image
|
93 |
|
94 |
|
95 |
-
title = "Invoice Information extraction
|
96 |
-
description = "Invoice Information Extraction
|
97 |
-
|
98 |
-
article="<b>References</b><br>[1] Y. Xu et al., “LayoutLMv3: Pre-training for Document AI with Unified Text and Image Masking.” 2022. <a href='https://arxiv.org/abs/2204.08387'>Paper Link</a><br>[2] <a href='https://github.com/NielsRogge/Transformers-Tutorials/tree/master/LayoutLMv3'>LayoutLMv3 training and inference</a>"
|
99 |
-
|
100 |
-
examples =[['example1.png'],['example2.png'],['example3.png']]
|
101 |
|
102 |
-
css = """.output_image, .input_image {height: 600px !important}"""
|
103 |
|
104 |
iface = gr.Interface(fn=process_image,
|
105 |
inputs=gr.inputs.Image(type="pil"),
|
106 |
outputs=gr.outputs.Image(type="pil", label="annotated image"),
|
107 |
title=title,
|
108 |
description=description,
|
109 |
-
article=article,
|
110 |
-
examples=examples,
|
111 |
-
css=css,
|
112 |
analytics_enabled = True, enable_queue=True)
|
113 |
|
114 |
iface.launch(inline=False, share=False, debug=False)
|
|
|
1 |
import os
|
|
|
|
|
2 |
import gradio as gr
|
3 |
import numpy as np
|
4 |
from transformers import AutoModelForTokenClassification
|
|
|
90 |
return image
|
91 |
|
92 |
|
93 |
+
title = "Invoice Information extraction by Mohit Kumar"
|
94 |
+
description = "Invoice Information Extraction for Biller Name, Biller Address, Biller post_code, Due_date, GST, Invoice_date, Invoice_number, Subtotal and Total. To use it, simply upload an image or use the example image below. Results will show up in a few seconds."
|
|
|
|
|
|
|
|
|
95 |
|
|
|
96 |
|
97 |
iface = gr.Interface(fn=process_image,
|
98 |
inputs=gr.inputs.Image(type="pil"),
|
99 |
outputs=gr.outputs.Image(type="pil", label="annotated image"),
|
100 |
title=title,
|
101 |
description=description,
|
|
|
|
|
|
|
102 |
analytics_enabled = True, enable_queue=True)
|
103 |
|
104 |
iface.launch(inline=False, share=False, debug=False)
|