Welcome to the ICU Monitor Data Extraction app! This app utilizes OpenAI's Vision API to analyze ICU monitor images, extract vital signs like heart rate (HR), blood pressure (BP), oxygen saturation (SpO2), respiratory rate (RR), temperature, and more. The app displays these vital signs in a user-friendly table format. 🌟
- Upload ICU Monitor Image: Upload an image from a patient monitor.
- Image Analysis: The app uses OpenAI's Vision API to analyze the uploaded image and extract vital signs.
- Data Extraction: The extracted vital signs such as HR, BP, SpO2, and more are parsed and displayed in a structured tabular format.
- Streamlit Interface: The app provides a user-friendly interface where users can upload images and view the extracted data.
- Python 3.10 or above
- An OpenAI API key (set up via
.env
for local development or Streamlit Secrets for deployment).
git clone https://github.com/alphatechlogics/ICUMonitorScreenReader.git
cd icu-monitor-data-extraction
python3 -m venv env
source env/bin/activate
# On Windows:env\Scripts\activate
pip install -r requirements.txt
- Locally: Create a .env file in the root of the project and add your OpenAI API key:
OPENAI_API_KEY=your-openai-api-key
- Streamlit Deployment: Store the OpenAI API key in the .streamlit/secrets.toml file as:
[general]
OPENAI_API_KEY = "your-openai-api-key"
streamlit run app.py
The app will open in your browser at http://localhost:8501.
🧑⚕️ Features
- ICU Monitor Image Analysis: Analyze uploaded images from ICU monitors.
- Vital Sign Extraction: Extracts and displays vital signs such as heart rate (HR), blood pressure (BP), oxygen saturation (SpO2), respiratory rate (RR), and temperature.
- Structured Data Display: Displays the extracted data in a neat tabular format using pandas.
- Dynamic API Key Handling: Automatically uses API key from
.env
file locally and from Streamlit Secrets when deployed.
⚙️ Key Technologies
- OpenAI Vision API: Used to extract and analyze the content from the ICU monitor images.
Learn more about OpenAI's Vision API here: OpenAI Vision API Documentation - Streamlit: Provides an easy-to-use web interface for the app.
- Python Libraries:
openai
: OpenAI API wrapper.streamlit
: For creating the web interface.Pillow
: For image processing.python-dotenv
: For loading environment variables locally.pandas
: For handling and displaying extracted data in a tabular format.
💡 Usage
-
Upload Image:
Click the "Upload ICU Monitor Image" button and select an image of an ICU monitor display (JPG, JPEG, PNG). -
View Data:
Once the image is uploaded, the app will display the vital signs extracted from the image in a structured table.
Heart Rate (HR) | Blood Pressure | Oxygen Saturation (SpO2) | Temperature | Respiratory Rate (RR) |
---|---|---|---|---|
75 bpm | 120/80 mmHg | 98% | 37.0°C | 16 breaths/min |