Spaces:
Running on Zero
Running on Zero
| # 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. | |