File size: 470 Bytes
302084a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gradio as gr
from PIL import Image
import pytesseract

def extract_data_from_blueprint(image):
    # Convert image to text using OCR
    text = pytesseract.image_to_string(image)
    # Add custom logic to parse the text into structured data
    return {"extracted_text": text}

interface = gr.Interface(
    fn=extract_data_from_blueprint,
    inputs=gr.Image(type="pil", label="Upload Blueprint"),
    outputs=gr.JSON(label="Extracted Data")
)
interface.launch()