IcecreamDetect / README_HF_SPACE.md
ibsocr1's picture
Upload 13 files
47f2ebf verified
|
Raw
History Blame Contribute Delete
674 Bytes
# 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.