Spaces:
Paused
Paused
Create image_ocr_llm.py
Browse files- tabs/image_ocr_llm.py +14 -0
tabs/image_ocr_llm.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from components.llm_ocr import extract_text_llm
|
| 3 |
+
|
| 4 |
+
def image_ocr_llm_tab():
|
| 5 |
+
gr.Markdown("## 📸 Extract Handwritten Text from Image using LLaMA-Vision", elem_classes="centered-text")
|
| 6 |
+
|
| 7 |
+
with gr.Row():
|
| 8 |
+
with gr.Column(scale=1):
|
| 9 |
+
input_image = gr.Image(type="filepath", label="Upload Handwritten Image")
|
| 10 |
+
submit_btn = gr.Button("Extract Text")
|
| 11 |
+
with gr.Column(scale=2):
|
| 12 |
+
extracted_output = gr.Textbox(label="Extracted Text", lines=20)
|
| 13 |
+
|
| 14 |
+
submit_btn.click(fn=extract_text_llm, inputs=input_image, outputs=extracted_output)
|