Spaces:
Build error
Build error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from PIL import Image
|
3 |
+
import pytesseract
|
4 |
+
|
5 |
+
def extract_data_from_blueprint(image):
|
6 |
+
# Convert image to text using OCR
|
7 |
+
text = pytesseract.image_to_string(image)
|
8 |
+
# Add custom logic to parse the text into structured data
|
9 |
+
return {"extracted_text": text}
|
10 |
+
|
11 |
+
interface = gr.Interface(
|
12 |
+
fn=extract_data_from_blueprint,
|
13 |
+
inputs=gr.Image(type="pil", label="Upload Blueprint"),
|
14 |
+
outputs=gr.JSON(label="Extracted Data")
|
15 |
+
)
|
16 |
+
interface.launch()
|