Spaces:
Running
Running
| title: Gender Classification API | |
| colorFrom: indigo | |
| colorTo: blue | |
| sdk: docker | |
| pinned: false | |
| # Gender Classification API (Docker) | |
| This is a Hugging Face Space API using FastAPI + Docker to classify gender from an image using [`prithivMLmods/Gender-Classifier-Mini`](https://huggingface.co/prithivMLmods/Gender-Classifier-Mini). | |
| ## Usage | |
| Make a `POST` request to: | |
| ``` | |
| https://benstaf-gender-api-fastapi.hf.space/classify/ | |
| ``` | |
| with a JPEG/PNG image of a face. | |
| ## Example (Python) | |
| ```python | |
| import requests | |
| with open("face.jpg", "rb") as f: | |
| response = requests.post( | |
| "https://benstaf-gender-api-fastapi.hf.space/classify/", | |
| files={"image": f} | |
| ) | |
| print(response.json()) | |
| ``` | |
| **Response format:** | |
| ```json | |
| { | |
| "label": "female", | |
| "confidence": 0.987 | |
| } | |
| ``` | |
| ## Model | |
| This API uses a lightweight gender classifier fine-tuned on vision models, optimized for single-face inputs. |