trissondon
commited on
Commit
·
a5e09b7
1
Parent(s):
fbf1632
Updated app
Browse files
app.py
CHANGED
@@ -1,6 +1,4 @@
|
|
1 |
import os
|
2 |
-
#os.system("pip uninstall -y gradio")
|
3 |
-
#os.system("pip install gradio==4.19.0")
|
4 |
os.system('pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu')
|
5 |
|
6 |
import gradio as gr
|
@@ -100,9 +98,11 @@ def process_image_2(image):
|
|
100 |
|
101 |
|
102 |
|
103 |
-
title = "Document Layout Detection"
|
104 |
description = "Using Layout_LM_v3 model for invoice information extraction"
|
105 |
|
|
|
|
|
106 |
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>"
|
107 |
|
108 |
css = """.output_image, .input_image {height: 600px !important}"""
|
@@ -112,9 +112,10 @@ iface = gr.Interface(fn=process_image,
|
|
112 |
outputs=gr.Image(type="pil", label="annotated image"),
|
113 |
title=title,
|
114 |
description=description,
|
115 |
-
|
116 |
-
|
117 |
css=css)
|
118 |
|
|
|
119 |
iface.launch(inline=False, share=False, debug=False)
|
120 |
|
|
|
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
|
|
|
98 |
|
99 |
|
100 |
|
101 |
+
title = "Document Layout Detection v3"
|
102 |
description = "Using Layout_LM_v3 model for invoice information extraction"
|
103 |
|
104 |
+
examples =[['example1.png'],['example2.png'],['example3.png']]
|
105 |
+
|
106 |
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>"
|
107 |
|
108 |
css = """.output_image, .input_image {height: 600px !important}"""
|
|
|
112 |
outputs=gr.Image(type="pil", label="annotated image"),
|
113 |
title=title,
|
114 |
description=description,
|
115 |
+
article=article,
|
116 |
+
examples=examples,
|
117 |
css=css)
|
118 |
|
119 |
+
|
120 |
iface.launch(inline=False, share=False, debug=False)
|
121 |
|