Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
@@ -1,21 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# Gender Classification API (Docker)
|
2 |
|
3 |
-
This is a Hugging Face Space API using FastAPI + Docker to classify gender from an image using `prithivMLmods/Gender-Classifier-Mini
|
4 |
|
5 |
## Usage
|
6 |
|
7 |
-
POST to:
|
8 |
|
9 |
```
|
10 |
https://benstaf-gender-api-fastapi.hf.space/classify/
|
11 |
```
|
12 |
|
|
|
|
|
13 |
## Example (Python)
|
14 |
|
15 |
```python
|
16 |
import requests
|
17 |
|
18 |
with open("face.jpg", "rb") as f:
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
```
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: Gender Classification API
|
3 |
+
colorFrom: indigo
|
4 |
+
colorTo: blue
|
5 |
+
sdk: docker
|
6 |
+
pinned: false
|
7 |
+
---
|
8 |
+
|
9 |
# Gender Classification API (Docker)
|
10 |
|
11 |
+
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).
|
12 |
|
13 |
## Usage
|
14 |
|
15 |
+
Make a `POST` request to:
|
16 |
|
17 |
```
|
18 |
https://benstaf-gender-api-fastapi.hf.space/classify/
|
19 |
```
|
20 |
|
21 |
+
with a JPEG/PNG image of a face.
|
22 |
+
|
23 |
## Example (Python)
|
24 |
|
25 |
```python
|
26 |
import requests
|
27 |
|
28 |
with open("face.jpg", "rb") as f:
|
29 |
+
response = requests.post(
|
30 |
+
"https://benstaf-gender-api-fastapi.hf.space/classify/",
|
31 |
+
files={"image": f}
|
32 |
+
)
|
33 |
+
print(response.json())
|
34 |
+
```
|
35 |
+
|
36 |
+
**Response format:**
|
37 |
+
```json
|
38 |
+
{
|
39 |
+
"label": "female",
|
40 |
+
"confidence": 0.987
|
41 |
+
}
|
42 |
```
|
43 |
+
|
44 |
+
## Model
|
45 |
+
|
46 |
+
This API uses a lightweight gender classifier fine-tuned on vision models, optimized for single-face inputs.
|