File size: 674 Bytes
47f2ebf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Hugging Face Space configuration

Create a **Docker Space** and upload the project files.

The Space should contain:

```text
Dockerfile
requirements.txt
app/
model/
```

For a model stored on the Hugging Face Hub, you can instead omit the local `model/` directory and set the Space variables:

```text
MODEL_ID=YOUR_USERNAME/YOUR_MODEL_REPO
HF_TOKEN=hf_your_token_if_private
```

The API starts on port 7860.

Endpoints:

- `GET /health`
- `POST /predict`
- `GET /docs`

Example:

```bash
curl -X POST \
  -F "file=@freezer.jpg" \
  "https://YOUR-SPACE-NAME.hf.space/predict?return_image=true"
```

The `annotated_image_base64` field contains the annotated result image.