Spaces:
Sleeping
Sleeping
| title: RespireX Backend | |
| emoji: π« | |
| colorFrom: blue | |
| colorTo: red | |
| sdk: docker | |
| app_port: 7860 | |
| pinned: false | |
| tags: | |
| - django | |
| - tensorflow | |
| - medical-ai | |
| - backend | |
| # π« RespireX - AI-Powered Disease Detection API | |
| This is the **Backend API** for **RespireX**, an AI-powered medical diagnostic application designed to detect respiratory diseases (like Tuberculosis and Pneumonia) and skin conditions using Deep Learning. | |
| It serves as the inference engine for the RespireX Frontend (deployed on Vercel). | |
| ## π Tech Stack | |
| * **Framework:** Django (Python) & Django REST Framework | |
| * **ML Engine:** TensorFlow / Keras | |
| * **Model Architecture:** EfficientNetB0 | |
| * **Database:** PostgreSQL (Supabase) | |
| * **Deployment:** Docker on Hugging Face Spaces | |
| ## π API Endpoints | |
| The backend exposes the following REST API endpoints: | |
| | Method | Endpoint | Description | | |
| | :--- | :--- | :--- | | |
| | `GET` | `/` | Health check / Welcome message | | |
| | `POST` | `/api/auth/` | User authentication (Supabase Integration) | | |
| | `POST` | `/api/predict/` | Upload X-Ray/Image for disease prediction | | |
| | `GET` | `/api/history/` | Fetch past test results | | |
| ## π οΈ Environment Variables | |
| To run this project, the following environment variables must be set in the **Settings > Variables and Secrets** tab of your Space: | |
| * `SECRET_KEY`: Django secret key. | |
| * `DEBUG`: `False` (for production). | |
| * `DATABASE_URL`: Connection string for Supabase PostgreSQL (Transaction Pooler). | |
| * `SUPABASE_URL`: Your Supabase Project URL. | |
| * `SUPABASE_KEY`: Your Supabase Anon Key. | |
| * `AWS_ACCESS_KEY_ID`: (Optional) For email services. | |
| * `AWS_SECRET_ACCESS_KEY`: (Optional) For email services. | |
| ## π³ Local Development (Docker) | |
| To run this backend locally using Docker: | |
| 1. **Build the image:** | |
| ```bash | |
| docker build -t respirex-backend . | |
| ``` | |
| 2. **Run the container:** | |
| ```bash | |
| docker run -p 7860:7860 --env-file .env respirex-backend | |
| ``` | |
| ## π¦ Model Information | |
| * **Model File:** `efficientnet_b0.h5` | |
| * **Input Shape:** `(224, 224, 3)` | |
| * **Performance:** Optimized for high sensitivity in chest X-ray analysis. | |
| --- | |
| *Built with β€οΈ by the RespireX Team* |