Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -70,19 +70,28 @@ def process_pdf(pdf_file):
|
|
70 |
|
71 |
# Create Gradio interface
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
|
85 |
-
|
86 |
-
iface.launch()
|
87 |
|
88 |
|
|
|
70 |
|
71 |
# Create Gradio interface
|
72 |
|
73 |
+
with gr.Blocks() as app:
|
74 |
+
gr.Markdown(
|
75 |
+
"""
|
76 |
+
# PDF Figures and Tables Extraction
|
77 |
+
Upload a PDF file to extract figures and tables using YOLOv10.
|
78 |
+
"""
|
79 |
+
)
|
80 |
+
|
81 |
+
with gr.Row():
|
82 |
+
with gr.Column():
|
83 |
+
file_input = gr.File(label="Upload a PDF")
|
84 |
+
with gr.Column():
|
85 |
+
extract_button = gr.Button("Extract")
|
86 |
+
|
87 |
+
with gr.Row():
|
88 |
+
with gr.Column():
|
89 |
+
figures_gallery = gr.Gallery(label="Figures from PDF", object_fit='scale-down')
|
90 |
+
with gr.Column():
|
91 |
+
tables_gallery = gr.Gallery(label="Tables from PDF", object_fit='scale-down')
|
92 |
+
|
93 |
+
extract_button.click(process_pdf, inputs=file_input, outputs=[figures_gallery, tables_gallery])
|
94 |
|
95 |
+
app.launch()
|
|
|
96 |
|
97 |
|