xrAI is a modern web application designed for automated classification of chest X-rays. It uses deep learning to identify conditions such as Normal, Pneumonia, and TB.
- Deep Learning Inference: Fast and accurate X-ray classification.
- Grad-CAM Visualization: View heatmaps showing which areas the AI focused on.
- Modern UI: Clean, clinical-grade interface built with Next.js.
- Frontend: Next.js (React), TailwindCSS, Axios
- Backend: Flask (Python), PyTorch, OpenCV
- Navigate to the
backenddirectory:cd backend - Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Create a
.envfile from the example:cp .env.example .env
- Run the server:
python app.py
- Navigate to the
frontend/my-appdirectory:cd frontend/my-app - Install dependencies:
npm install
- Create a
.env.localfile:NEXT_PUBLIC_API_URL=http://localhost:5000
- Run the development server:
npm run dev
This project is configured for deployment on Render.
- Use the
backend/render.yamlblueprint. - Ensure you have the
best_xray_model.pthfile in thebackenddirectory.
- Set the
NEXT_PUBLIC_API_URLenvironment variable to your deployed backend URL.
PORT: The port the Flask server will run on (default: 5000).
NEXT_PUBLIC_API_URL: The URL of the Flask backend.