Update README.md
Browse files
README.md
CHANGED
|
@@ -22,8 +22,33 @@ The **Food Portion Benchmark (FPB)** is a comprehensive dataset and benchmark su
|
|
| 22 |
Each food item was weighed and categorized into small, medium, or large portions. Images were captured from different angles to enable robust volume and weight estimation.
|
| 23 |

|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
---
|
| 26 |
|
|
|
|
|
|
|
| 27 |
## π§ Model Overview
|
| 28 |
|
| 29 |
The baseline model is a **YOLOv12** multitask variant, extended with a **regression head** for predicting food weight (see Figure below). It was designed to be **agnostic to missing labels**, making it compatible with datasets that do not have weight annotations.
|
|
@@ -47,16 +72,25 @@ The baseline model is a **YOLOv12** multitask variant, extended with a **regress
|
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
-
---
|
| 51 |
|
| 52 |
-
##
|
| 53 |
|
| 54 |
-
|
| 55 |
-
- π **Evaluate Your Model**: Submit predictions on the test set using the [automated score-checker](https://huggingface.co/datasets/issai/Food_Portion_Benchmark/tree/main/score-checker)
|
| 56 |
|
| 57 |
-
|
|
|
|
|
|
|
| 58 |
|
|
|
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
|
| 62 |
---
|
|
|
|
| 22 |
Each food item was weighed and categorized into small, medium, or large portions. Images were captured from different angles to enable robust volume and weight estimation.
|
| 23 |

|
| 24 |
|
| 25 |
+
|
| 26 |
+
## π Dataset Structure and Format
|
| 27 |
+
|
| 28 |
+
The FPB dataset follows the **YOLO annotation format**, with a custom 6th column for **food weight (in grams)**.
|
| 29 |
+
|
| 30 |
+
### π§Ύ Label Format (YOLO-style with weight)
|
| 31 |
+
- `class_id`: ID of the food class (0β137)
|
| 32 |
+
- `x_center, y_center, width, height`: Bounding box coordinates (normalized to [0, 1])
|
| 33 |
+
- `weight`: Ground truth weight in grams (used for regression)
|
| 34 |
+
|
| 35 |
+
Each `.txt` file matches the name of its corresponding image file.
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
## π₯ Dataset Access & Benchmarking
|
| 41 |
+
|
| 42 |
+
- π¦ **Download Dataset**: [Hugging Face link](https://huggingface.co/datasets/issai/Food_Portion_Benchmark)
|
| 43 |
+
- π **Evaluate Your Model**: Submit predictions on the test set using the [automated score-checker](https://huggingface.co/datasets/issai/Food_Portion_Benchmark/tree/main/score-checker)
|
| 44 |
+
|
| 45 |
+
Test labels are hidden to ensure fair evaluation.
|
| 46 |
+
|
| 47 |
+
|
| 48 |
---
|
| 49 |
|
| 50 |
+
|
| 51 |
+
|
| 52 |
## π§ Model Overview
|
| 53 |
|
| 54 |
The baseline model is a **YOLOv12** multitask variant, extended with a **regression head** for predicting food weight (see Figure below). It was designed to be **agnostic to missing labels**, making it compatible with datasets that do not have weight annotations.
|
|
|
|
| 72 |
|
| 73 |
|
| 74 |
|
|
|
|
| 75 |
|
| 76 |
+
## ποΈββοΈ Training
|
| 77 |
|
| 78 |
+
Train the multi-task YOLOv12 model using:
|
|
|
|
| 79 |
|
| 80 |
+
</pre>
|
| 81 |
+
python train.py
|
| 82 |
+
</pre>
|
| 83 |
|
| 84 |
+
## π Inference
|
| 85 |
|
| 86 |
+
Download the trained best model from the [drive link](https://huggingface.co/datasets/issai/Food_Portion_Benchmark) and run inference on test images using:
|
| 87 |
+
|
| 88 |
+
</pre>
|
| 89 |
+
python test.py
|
| 90 |
+
</pre>
|
| 91 |
+
- Provide path to your images folder or image file
|
| 92 |
+
- Replace `model` with the path to the downloaded model
|
| 93 |
+
- Set `show=True` to save annotated images with bounding boxes and predicted weights
|
| 94 |
|
| 95 |
|
| 96 |
---
|