Spaces:
Runtime error
Runtime error
Update README.md
Browse files
README.md
CHANGED
|
@@ -1 +1,29 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Food‑Recognition API
|
| 3 |
+
emoji: 🍎
|
| 4 |
+
colorFrom: red
|
| 5 |
+
colorTo: yellow
|
| 6 |
+
sdk: docker
|
| 7 |
+
sdk_version: "4"
|
| 8 |
+
python_version: "3.11"
|
| 9 |
+
app_file: app.py
|
| 10 |
+
pinned: false
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# 🍎 Food‑Recognition API (Hugging Face Space)
|
| 14 |
+
|
| 15 |
+
This Space runs a tiny **FastAPI** service that wraps the model
|
| 16 |
+
`BinhQuocNguyen/food-recognition-model`.
|
| 17 |
+
|
| 18 |
+
It:
|
| 19 |
+
|
| 20 |
+
* loads the food‑recognition model once at start‑up
|
| 21 |
+
* accepts an image (base‑64‑encoded) via **POST `/analyze`**
|
| 22 |
+
* returns the top food label, a confidence score, an estimated portion weight (g) and the estimated calories for that portion.
|
| 23 |
+
|
| 24 |
+
## 🚀 How to call the API
|
| 25 |
+
|
| 26 |
+
```bash
|
| 27 |
+
curl -X POST https://<your‑username>-my-food-api.hf.space/analyze \
|
| 28 |
+
-H "Content-Type: application/json" \
|
| 29 |
+
-d '{"image":"<base64‑string>"}'
|