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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
- split: s4
|
| 45 |
path: data/s4-*
|
| 46 |
---
|
| 47 |
+
|
| 48 |
+
# π³ Breakfast Actions Dataset (HF + WebDataset Ready)
|
| 49 |
+
|
| 50 |
+
This repository hosts the **Breakfast Actions** dataset metadata and videos, organized for modern deep learning workflows.
|
| 51 |
+
It provides:
|
| 52 |
+
|
| 53 |
+
- 4 evaluation splits (`s1`, `s2`, `s3`, `s4`)
|
| 54 |
+
- JSONL metadata describing each video, participant, camera, and frame-level action segments
|
| 55 |
+
- Raw AVI videos stored directly on HuggingFace
|
| 56 |
+
- Optional WebDataset shards for streaming training
|
| 57 |
+
|
| 58 |
+
---
|
| 59 |
+
|
| 60 |
+
## π Folder Layout
|
| 61 |
+
|
| 62 |
+
```
|
| 63 |
+
Breakfast-Actions/
|
| 64 |
+
β
|
| 65 |
+
βββ Converted_Data/
|
| 66 |
+
β βββ metadata_s1.jsonl
|
| 67 |
+
β βββ metadata_s2.jsonl
|
| 68 |
+
β βββ metadata_s3.jsonl
|
| 69 |
+
β βββ metadata_s4.jsonl
|
| 70 |
+
β
|
| 71 |
+
βββ Videos/
|
| 72 |
+
β βββ P03/cam01/*.avi
|
| 73 |
+
β βββ P03/cam02/*.avi
|
| 74 |
+
β βββ P04/cam01/*.avi
|
| 75 |
+
β βββ ... (participants P03βP54, multiple cameras)
|
| 76 |
+
β
|
| 77 |
+
βββ WebDataset_Shards/ (optional)
|
| 78 |
+
βββ 000000.tar
|
| 79 |
+
βββ 000001.tar
|
| 80 |
+
βββ ...
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
---
|
| 84 |
+
|
| 85 |
+
## π JSONL Record Format
|
| 86 |
+
|
| 87 |
+
Each metadata line looks like:
|
| 88 |
+
|
| 89 |
+
```json
|
| 90 |
+
{
|
| 91 |
+
"video_path": "Videos/P03/cam01/P03_coffee.avi",
|
| 92 |
+
"participant": "P03",
|
| 93 |
+
"camera": "cam01",
|
| 94 |
+
"video": "P03_coffee",
|
| 95 |
+
"labels": [
|
| 96 |
+
{"start": 1, "end": 385, "label": "SIL"},
|
| 97 |
+
{"start": 385, "end": 599, "label": "pour_oil"},
|
| 98 |
+
...
|
| 99 |
+
]
|
| 100 |
+
}
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
All video paths match the directory structure inside the HF repo.
|
| 104 |
+
|
| 105 |
+
---
|
| 106 |
+
|
| 107 |
+
## πΉ Load Metadata Using HuggingFace Datasets
|
| 108 |
+
|
| 109 |
+
```python
|
| 110 |
+
from datasets import load_dataset
|
| 111 |
+
|
| 112 |
+
ds = load_dataset("json", data_files="metadata_s2.jsonl")["train"]
|
| 113 |
+
|
| 114 |
+
# Select all videos belonging to split s2
|
| 115 |
+
subset = ds
|
| 116 |
+
```
|
| 117 |
+
|
| 118 |
+
---
|
| 119 |
+
|
| 120 |
+
## πΉ Load and Decode a Video
|
| 121 |
+
|
| 122 |
+
### Using Decord
|
| 123 |
+
|
| 124 |
+
```python
|
| 125 |
+
from decord import VideoReader
|
| 126 |
+
item = ds[0]
|
| 127 |
+
|
| 128 |
+
vr = VideoReader(item["video_path"])
|
| 129 |
+
frame0 = vr[0] # first frame
|
| 130 |
+
```
|
| 131 |
+
|
| 132 |
+
### Using TorchVision
|
| 133 |
+
|
| 134 |
+
```python
|
| 135 |
+
from torchvision.io import read_video
|
| 136 |
+
video, audio, info = read_video(item["video_path"])
|
| 137 |
+
```
|
| 138 |
+
|
| 139 |
+
---
|
| 140 |
+
|
| 141 |
+
## πΉ WebDataset Version (Optional)
|
| 142 |
+
|
| 143 |
+
If the dataset includes `.tar` shards:
|
| 144 |
+
|
| 145 |
+
```python
|
| 146 |
+
import webdataset as wds, jsonlines
|
| 147 |
+
|
| 148 |
+
ids = [rec["video_path"] for rec in jsonlines.open("metadata_s2.jsonl")]
|
| 149 |
+
dset = wds.WebDataset("WebDataset_Shards/*.tar").select(lambda s: s["json"]["video_path"] in ids)
|
| 150 |
+
```
|
| 151 |
+
|
| 152 |
+
Each shard contains:
|
| 153 |
+
|
| 154 |
+
- `xxx.avi` β video bytes
|
| 155 |
+
- `xxx.json` β metadata JSON
|
| 156 |
+
|
| 157 |
+
---
|
| 158 |
+
|
| 159 |
+
## πΉ PyTorch Example
|
| 160 |
+
|
| 161 |
+
```python
|
| 162 |
+
from torch.utils.data import Dataset, DataLoader
|
| 163 |
+
from decord import VideoReader
|
| 164 |
+
|
| 165 |
+
class BreakfastDataset(Dataset):
|
| 166 |
+
def __init__(self, subset): self.subset = subset
|
| 167 |
+
def __len__(self): return len(self.subset)
|
| 168 |
+
def __getitem__(self, idx):
|
| 169 |
+
item = self.subset[idx]
|
| 170 |
+
vr = VideoReader(item["video_path"])
|
| 171 |
+
frames = vr.get_batch([0, 8, 16])
|
| 172 |
+
return frames, item["labels"]
|
| 173 |
+
|
| 174 |
+
loader = DataLoader(BreakfastDataset(ds), batch_size=4)
|
| 175 |
+
```
|
| 176 |
+
|
| 177 |
+
---
|
| 178 |
+
|
| 179 |
+
## π’ Splits Description
|
| 180 |
+
|
| 181 |
+
The dataset is partitioned by participant ID:
|
| 182 |
+
|
| 183 |
+
| Split | Participants |
|
| 184 |
+
|-------|--------------|
|
| 185 |
+
| **s1** | P03βP15 |
|
| 186 |
+
| **s2** | P16βP28 |
|
| 187 |
+
| **s3** | P29βP41 |
|
| 188 |
+
| **s4** | P42βP54 |
|
| 189 |
+
|
| 190 |
+
Each split has its own metadata JSONL file.
|
| 191 |
+
|
| 192 |
+
---
|
| 193 |
+
|
| 194 |
+
## π Citation
|
| 195 |
+
|
| 196 |
+
If you use the Breakfast Actions dataset, please cite:
|
| 197 |
+
|
| 198 |
+
```bibtex
|
| 199 |
+
@inproceedings{kuehne2014language,
|
| 200 |
+
title={The language of actions: Recovering the syntax and semantics of goal-directed human activities},
|
| 201 |
+
author={Kuehne, Hildegard and Arslan, Ali and Serre, Thomas},
|
| 202 |
+
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
|
| 203 |
+
pages={780--787},
|
| 204 |
+
year={2014}
|
| 205 |
+
}
|
| 206 |
+
```
|
| 207 |
+
|
| 208 |
+
---
|
| 209 |
+
|
| 210 |
+
## β Summary
|
| 211 |
+
|
| 212 |
+
- 4 official splits (s1βs4)
|
| 213 |
+
- Metadata in JSONL β converted to parquet automatically on HF
|
| 214 |
+
- Videos usable directly on HF without full download
|
| 215 |
+
- Optional WebDataset tar shards for high-speed streaming
|
| 216 |
+
- Ready for video classification and temporal segmentation tasks
|
| 217 |
+
|
| 218 |
+
This setup is ideal for research, prototyping, and reproducible benchmarking.
|
| 219 |
+
|
| 220 |
+
|