bLoOd_AI / app.py
erayman09's picture
Update app.py
22d46ec verified
raw
history blame contribute delete
891 Bytes
import streamlit as st
from PIL import Image
import pytesseract
import pandas as pd
import re
st.title("Blood Test Analyzer with RAG")
st.write("Upload an image of your blood test report to analyze and get recommendations.")
uploaded_file = st.file_uploader("Upload Image", type=["png", "jpg", "jpeg"])
if uploaded_file is not None:
try:
# Load the image
image = Image.open(uploaded_file)
st.image(image, caption="Uploaded Image", use_container_width=True)
# Step 1: Extract text using Tesseract
extracted_text = pytesseract.image_to_string(image)
st.text_area("Extracted Text", extracted_text, height=200)
# Placeholder for parsed data
st.subheader("Flagged Abnormalities")
st.write("Parsing logic and RAG recommendations will go here.")
except Exception as e:
st.error(f"An error occurred: {e}")