File size: 779 Bytes
7727242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Food‑Recognition API
emoji: 🍎
colorFrom: red
colorTo: yellow
sdk: docker
sdk_version: "4"
python_version: "3.11"
app_file: app.py
pinned: false
---

# 🍎 Food‑Recognition API (Hugging Face Space)

This Space runs a tiny **FastAPI** service that wraps the model  
`BinhQuocNguyen/food-recognition-model`.  

It:

* loads the food‑recognition model once at start‑up  
* accepts an image (base‑64‑encoded) via **POST `/analyze`**  
* returns the top food label, a confidence score, an estimated portion weight (g) and the estimated calories for that portion.

## 🚀 How to call the API

```bash
curl -X POST https://<your‑username>-my-food-api.hf.space/analyze \
     -H "Content-Type: application/json" \
     -d '{"image":"<base64‑string>"}'