Spaces:
Build error
Build error
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() |