This project implements a Gradio-based application that utilizes the MAIRA-2 model from Microsoft to generate radiology reports from chest X-ray images. Users can input URLs for frontal and lateral chest X-ray images, along with relevant clinical information, to automatically generate findings.
1
stars
6
commits
Python
primary language
Feb 10, 2025
updated
This project implements a Gradio-based application that utilizes the MAIRA-2 model from Microsoft to generate radiology reports from chest X-ray images. Users can input URLs for frontal and lateral chest X-ray images, along with relevant clinical information, to automatically generate findings.
Application Screenshotrequirements.txt):
transformerstorchhuggingface_hubrequestsPillow (PIL)gradiosentencepieceprotobufClone the repository:
git clone https://github.com/mvdiogo/MAIRA-2-CXR-Report-Generator.git
cd MAIRA-2-CXR-Report-Generator
Create a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate # On Linux/macOS
venv\Scripts\activate # On Windows
Install the required packages:
pip install -r requirements.txt
pip install --force-reinstall git+https://github.com/huggingface/transformers.git@88d960937c81a32bfb63356a2e8ecf7999619681
Install PyTorch:
Refer to the official PyTorch website for installation instructions specific to your system: https://pytorch.org/get-started/locally/
Hugging Face Token:
To access the gated MAIRA-2 model, you'll need a Hugging Face token and permission.
Request Access: Go to https://huggingface.co/microsoft/maira-2/tree/main and request access to the model.
Generate Token: Create a Hugging Face token with read access at https://huggingface.co/settings/tokens.
Set Environment Variable: Set the HF_TOKEN environment variable (replace "your_huggingface_token" with your actual token):
export HF_TOKEN="your_huggingface_token" # Linux/macOS
set HF_TOKEN="your_huggingface_token" # Windows
Important: This is for development/testing only. For production environments, use secure methods for storing and accessing credentials. Never commit your token to public repositories.
Run the application:
python main.py
Open the URL provided in the console in your web browser. This will typically be something like http://127.0.0.1:7860 or a gradio.live URL.
Enter the URLs for the frontal and lateral chest X-ray images, along with the indication, comparison, and technique.
Click the "Generate Findings" button to generate the radiology report findings.
This project is for demonstration and educational purposes only and should not be used for clinical decision-making. Always consult with qualified healthcare professionals for medical advice.
6 commits
This project implements a Gradio-based application that utilizes the MAIRA-2 model from Microsoft to generate radiology reports from chest X-ray images. Users can input URLs for frontal and lateral chest X-ray images, along with relevant clinical information, to automatically generate findings.
1
stars
6
commits
Python
primary language
Feb 10, 2025
updated
This project implements a Gradio-based application that utilizes the MAIRA-2 model from Microsoft to generate radiology reports from chest X-ray images. Users can input URLs for frontal and lateral chest X-ray images, along with relevant clinical information, to automatically generate findings.
Application Screenshotrequirements.txt):
transformerstorchhuggingface_hubrequestsPillow (PIL)gradiosentencepieceprotobufClone the repository:
git clone https://github.com/mvdiogo/MAIRA-2-CXR-Report-Generator.git
cd MAIRA-2-CXR-Report-Generator
Create a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate # On Linux/macOS
venv\Scripts\activate # On Windows
Install the required packages:
pip install -r requirements.txt
pip install --force-reinstall git+https://github.com/huggingface/transformers.git@88d960937c81a32bfb63356a2e8ecf7999619681
Install PyTorch:
Refer to the official PyTorch website for installation instructions specific to your system: https://pytorch.org/get-started/locally/
Hugging Face Token:
To access the gated MAIRA-2 model, you'll need a Hugging Face token and permission.
Request Access: Go to https://huggingface.co/microsoft/maira-2/tree/main and request access to the model.
Generate Token: Create a Hugging Face token with read access at https://huggingface.co/settings/tokens.
Set Environment Variable: Set the HF_TOKEN environment variable (replace "your_huggingface_token" with your actual token):
export HF_TOKEN="your_huggingface_token" # Linux/macOS
set HF_TOKEN="your_huggingface_token" # Windows
Important: This is for development/testing only. For production environments, use secure methods for storing and accessing credentials. Never commit your token to public repositories.
Run the application:
python main.py
Open the URL provided in the console in your web browser. This will typically be something like http://127.0.0.1:7860 or a gradio.live URL.
Enter the URLs for the frontal and lateral chest X-ray images, along with the indication, comparison, and technique.
Click the "Generate Findings" button to generate the radiology report findings.
This project is for demonstration and educational purposes only and should not be used for clinical decision-making. Always consult with qualified healthcare professionals for medical advice.
6 commits
Python
100.0%