Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
6.6.0
metadata
title: MRI Orientation
emoji: 🐠
colorFrom: yellow
colorTo: gray
sdk: gradio
sdk_version: 6.2.0
app_file: app.py
pinned: false
MRI Orientation Predictor
This is a simple web application for predicting the orientation of MRI images using a YOLOv11 classification model that is already pretrained on several MRI datasets. It classifies images into axial, coaxial, or sagittal orientations and provides a confidence score.
Features
- Predict MRI orientation for uploaded images.
- Display confidence score for the prediction.
- Easy-to-use web interface powered by Gradio.
- Supports
.jpg,.jpeg, and.pngimages.
Model
The model is a YOLOv11 classification model saved as best.pt.
The model outputs short labels:
ax→ axialco→ coaxialsa→ sagittal
The application maps these short labels to full orientation names for easier understanding.
Installation
Install required packages:
pip install -r requirements.txt
Requirements.txt
The requirements.txt should include at least:
ultralytics
torch
torchvision
gradio
Pillow
Usage
- Place your YOLOv11 model file
best.ptin the project directory. - Run the Gradio app:
python app.py
- Upload an MRI image in the interface.
- The predicted orientation and confidence will be displayed.
Example Output
Orientation: axial | Confidence: 0.95
Orientation: coaxial | Confidence: 0.87
Orientation: sagittal | Confidence: 0.92
Notes
- Make sure your model is a YOLOv11 classification model saved as
.pt. - The model should return labels
"ax","co","sa"which are mapped to full names. - Confidence is reported as a float between 0 and 1.