File size: 912 Bytes
92c125d
 
 
 
 
 
 
 
ccd3d82
 
92c125d
ccd3d82
 
 
92c125d
ccd3d82
 
 
 
 
92c125d
 
ccd3d82
 
 
 
 
 
92c125d
 
 
 
 
 
 
 
 
 
 
 
 
ccd3d82
92c125d
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
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.