Spaces:
Sleeping
Sleeping
Commit ·
3705867
1
Parent(s): 0e92b30
Add Hugging Face Spaces metadata
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657# Depression Detection APIA FastAPI-based REST API for detecting depression from facial images using deep learning.## Features- **Face Detection**: Automatically detects and crops faces from uploaded images- **Depression Prediction**: Uses EfficientNetB0 model for binary classification- **Configurable Threshold**: Adjust prediction sensitivity via API parameter- **CORS Enabled**: Ready for mobile app integration## API Endpoints### `GET /health`Health check endpoint to verify API status.### `POST /predict`Upload an image to get depression prediction.**Parameters:**- `file`: Image file (JPEG, PNG, etc.)- `threshold`: Classification threshold (0.0-1.0, default: 0.5)**Response:**```json{"prediction": "depression" | "neutral","confidence": 0.75}```## Local Development1. Install dependencies:```bashpip install -r requirements.txt```2. Run the server:```bashuvicorn main:app --reload```3. Open API docs at `http://localhost:8000/docs`## Deployment to Render1. Push this repository to GitHub2. Connect your GitHub repo to Render3. Render will automatically detect `render.yaml` and deploy## Model Information- **Architecture**: EfficientNetB0 (transfer learning)- **Input**: 224x224 RGB images- **Output**: Binary classification (depression vs neutral)- **Training Data**: Face images from CalmScope dataset12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849---title: Depression Detection APIemoji: 🧠colorFrom: bluecolorTo: purplesdk: dockerpinned: falselicense: mit---# Depression Detection APIAPI for detecting depression from facial images using machine learning.## Endpoints| Endpoint | Method | Description ||----------|--------|-------------|| `/` | GET | API info || `/health` | GET | Health check || `/predict` | POST | Predict depression from image || `/docs` | GET | Interactive API documentation |## Usage### Health Check```bashcurl https://knowingfly-depression-detection-api.hf.space/health```### Prediction```bashcurl -X POST "https://knowingfly-depression-detection-api.hf.space/predict" \-F "file=@your_image.jpg"```### Response Format```json{"prediction": "depression" | "neutral","confidence": 0.85}```## Technology Stack- FastAPI- TensorFlow/Keras- OpenCV (Face Detection)- Docker
README.md+35-43