File size: 891 Bytes
22d46ec
 
cd6b2f5
1138794
cd6b2f5
 
22d46ec
 
cd6b2f5
efbd192
cd6b2f5
22d46ec
 
 
 
 
1138794
22d46ec
 
 
1138794
22d46ec
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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}")