README: release status, A/B/C counts, completeness guarantees, regen pipeline
Browse files
README.md
CHANGED
|
@@ -14,7 +14,7 @@ task_categories:
|
|
| 14 |
size_categories:
|
| 15 |
- 10K<n<100K
|
| 16 |
license: other
|
| 17 |
-
dataset_summary: "Spatio-temporal referring segmentation on dynamic 4D scenes: 89 bilingual queries with temporally gated dense mask GT across 12 scenes
|
| 18 |
---
|
| 19 |
|
| 20 |
# R4D-Bench
|
|
@@ -23,6 +23,22 @@ dataset_summary: "Spatio-temporal referring segmentation on dynamic 4D scenes: 8
|
|
| 23 |
- https://huggingface.co/datasets/LiYacheng/r4d-bench-qa-v2 (recommended)
|
| 24 |
- https://huggingface.co/datasets/LiYacheng/r4d-bench-qa
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
## What this dataset is
|
| 27 |
|
| 28 |
**R4D-Bench** is a benchmark for **spatio-temporal referring segmentation** in **dynamic (4D) scenes**: given a natural-language query, the model must return the correct **instance mask(s) over time**.
|
|
@@ -32,9 +48,9 @@ This release ships:
|
|
| 32 |
| Shipped | Count / note |
|
| 33 |
|---------|----------------|
|
| 34 |
| Scenes | **12** under `data/scenes/` |
|
| 35 |
-
| Referring queries | **89**
|
| 36 |
-
| Dense mask GT | Per-query, per-frame
|
| 37 |
-
| Temporal gating | Outside `expected_temporal_anchor`
|
| 38 |
| Eval scripts | Mask IoU (`evaluate_mask_temporal.py`) and track-ID F1 (`evaluate_r4dgs.py`) |
|
| 39 |
| Optional subset | **36** queries (3 / scene) for quick debugging |
|
| 40 |
|
|
@@ -90,15 +106,18 @@ Folders under `data/scenes/` (underscores):
|
|
| 90 |
|
| 91 |
Each scene typically contains:
|
| 92 |
|
| 93 |
-
- `*_queries.json` — queries for that scene
|
| 94 |
-
- scene track JSON (e.g. `americano.json`; `cook_spinach` uses `cook-spinach.json`)
|
| 95 |
- COCO annotation JSON (`_annotations*.coco.json`)
|
| 96 |
-
- `
|
|
|
|
|
|
|
| 97 |
- `query_masks/` — query-level union masks for the **89**-query set
|
| 98 |
-
- `query_masks_36/` — masks for the optional **36**-query subset
|
| 99 |
- `README.dataset.txt` / `README.roboflow.txt` — upstream provenance
|
| 100 |
|
| 101 |
-
**Naming:** folder names use `_`; some JSON / `query_id` prefixes use `-` (e.g. `cook-spinach`, `split-cookie`).
|
|
|
|
| 102 |
|
| 103 |
---
|
| 104 |
|
|
@@ -109,7 +128,15 @@ Each scene typically contains:
|
|
| 109 |
- **Output (track-ID track):** set of `target_track_ids` (no pixels).
|
| 110 |
- **Time index:** integer `frame_id` in GT / `existence_frames`, matching `query_masks/frame_XXXXXX/`.
|
| 111 |
- **Left / right:** means **image / viewer** coordinates (left or right side of the picture), **not** the person’s anatomical left/right hand.
|
| 112 |
-
- **Query
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
### Closed object vocabulary
|
| 115 |
|
|
@@ -124,10 +151,12 @@ Dense mask GT is built from `annotation_track_map.json` (union of all COCO piece
|
|
| 124 |
- **Inside** the anchor interval(s): normal object mask.
|
| 125 |
- **Outside** the interval: **empty / black** full-frame mask (`temporally_inactive: true`) — still listed in `frames[]`.
|
| 126 |
- **Empty interval list** (e.g. `intact: []`): the state never occurs → all frames black for that anchor.
|
| 127 |
-
- **
|
| 128 |
-
- **`
|
|
|
|
| 129 |
- **`existence_frames`:** only frames with a **positive** (non-empty) mask.
|
| 130 |
-
- Type **C** (zero-target): **explicit** empty mask+`size` on every annotated scene frame.
|
|
|
|
| 131 |
|
| 132 |
Eval: both empty → IoU `1.0`; predicting an object on a black GT frame → IoU `0.0`. Models must get **both identity and timing** right.
|
| 133 |
|
|
@@ -142,7 +171,7 @@ Each entry includes among others:
|
|
| 142 |
- `query_id`, `scene`, `text_en`, `text_zh`
|
| 143 |
- `target_track_ids`, `target_count`
|
| 144 |
- `object_vocabulary` (closed category list for this scene)
|
| 145 |
-
- `query_type`, `requires_motion_understanding`
|
| 146 |
- Optional: `temporal_relation`, `expected_temporal_anchor`, `distractor`, `note`, `vocabulary_note`
|
| 147 |
|
| 148 |
Dense GT entries in `scripts/new_predictions_ground_truth_all_queries.json` add `ground_truth` with `target_tracks`, `existence_frames`, `excluded_frames`, and `frames[].masks[]` (`segmentation` RLE with `size`, optional `combined_mask_image`). Geometry in `segmentation` / PNGs is authoritative.
|
|
@@ -213,18 +242,44 @@ R4D-Bench/
|
|
| 213 |
|
| 214 |
## Regenerating masks / GT (maintainers)
|
| 215 |
|
|
|
|
|
|
|
| 216 |
```bash
|
| 217 |
-
#
|
| 218 |
-
python scripts/
|
| 219 |
|
| 220 |
-
#
|
|
|
|
|
|
|
|
|
|
| 221 |
python scripts/predictions_ground_truth.py --all-queries \
|
| 222 |
--output scripts/new_predictions_ground_truth_all_queries.json
|
| 223 |
|
| 224 |
-
#
|
| 225 |
-
python scripts/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
```
|
| 227 |
|
|
|
|
|
|
|
| 228 |
---
|
| 229 |
|
| 230 |
## Relation to Segment-then-Splat & upstream data
|
|
|
|
| 14 |
size_categories:
|
| 15 |
- 10K<n<100K
|
| 16 |
license: other
|
| 17 |
+
dataset_summary: "Spatio-temporal referring segmentation on dynamic 4D scenes: 89 bilingual queries (A/B/C) with temporally gated dense mask GT on every annotated frame across 12 scenes; Mask IoU + track-ID eval."
|
| 18 |
---
|
| 19 |
|
| 20 |
# R4D-Bench
|
|
|
|
| 23 |
- https://huggingface.co/datasets/LiYacheng/r4d-bench-qa-v2 (recommended)
|
| 24 |
- https://huggingface.co/datasets/LiYacheng/r4d-bench-qa
|
| 25 |
|
| 26 |
+
## Release status
|
| 27 |
+
|
| 28 |
+
This release is treated as **annotation-complete** for the shipped 89-query benchmark:
|
| 29 |
+
|
| 30 |
+
| Guarantee | Status |
|
| 31 |
+
|-----------|--------|
|
| 32 |
+
| Every query × every annotated COCO frame has an `answer.png` | yes |
|
| 33 |
+
| `excluded_frames` (dropped frames) | **0** |
|
| 34 |
+
| Visible-but-unlabeled COCO gaps | filled (`_annotations_filled.coco.json`, 7 scenes) |
|
| 35 |
+
| RGB under `data/scenes/<scene>/images/` | present for all 12 scenes |
|
| 36 |
+
| Automated self-check (GT as prediction) | mIoU / Acc = 1.0 |
|
| 37 |
+
|
| 38 |
+
**What “black PNG” means (not a bug):** Type **C** (zero-target) queries are black on every frame; Type **A** queries are black **outside** their `expected_temporal_anchor` window. That is the temporal answer the model must get right.
|
| 39 |
+
|
| 40 |
+
**Residual risk:** a few temporal cuts remain RGB-judgment calls (exact pour start/stop, “intact” vs “breaking”). If a later visual audit finds a boundary off by ~10 frames, fix that track profile and regenerate — do not drop whole frames.
|
| 41 |
+
|
| 42 |
## What this dataset is
|
| 43 |
|
| 44 |
**R4D-Bench** is a benchmark for **spatio-temporal referring segmentation** in **dynamic (4D) scenes**: given a natural-language query, the model must return the correct **instance mask(s) over time**.
|
|
|
|
| 48 |
| Shipped | Count / note |
|
| 49 |
|---------|----------------|
|
| 50 |
| Scenes | **12** under `data/scenes/` |
|
| 51 |
+
| Referring queries | **89** bilingual (`text_en` / `text_zh`): **37 A** / **29 B** / **23 C** |
|
| 52 |
+
| Dense mask GT | Per-query, per-frame RLE + PNG unions under `query_masks/` |
|
| 53 |
+
| Temporal gating | Outside `expected_temporal_anchor` → **black** mask (frame still present) |
|
| 54 |
| Eval scripts | Mask IoU (`evaluate_mask_temporal.py`) and track-ID F1 (`evaluate_r4dgs.py`) |
|
| 55 |
| Optional subset | **36** queries (3 / scene) for quick debugging |
|
| 56 |
|
|
|
|
| 106 |
|
| 107 |
Each scene typically contains:
|
| 108 |
|
| 109 |
+
- `*_queries.json` — queries for that scene (source of truth for texts / targets / anchors)
|
| 110 |
+
- scene track JSON (e.g. `americano.json`; `cook_spinach` uses `cook-spinach.json`) — `temporal_profile` windows live here
|
| 111 |
- COCO annotation JSON (`_annotations*.coco.json`)
|
| 112 |
+
- optional `_annotations_filled.coco.json` — contour-propagated fills for formerly unlabeled visible frames
|
| 113 |
+
- `annotation_track_map.json` — COCO ann id → `track_id`
|
| 114 |
+
- `images/` — RGB frames paired with the annotations (same `frame_id` as masks)
|
| 115 |
- `query_masks/` — query-level union masks for the **89**-query set
|
| 116 |
+
- `query_masks_36/` — masks for the optional **36**-query subset
|
| 117 |
- `README.dataset.txt` / `README.roboflow.txt` — upstream provenance
|
| 118 |
|
| 119 |
+
**Naming:** folder names use `_`; some JSON / `query_id` prefixes use `-` (e.g. `cook-spinach`, `split-cookie`).
|
| 120 |
+
**First RGB frame** is scene-dependent (e.g. `americano` starts at `frame_00010`, not `00000`) — that is COCO coverage, not a missing GT bug.
|
| 121 |
|
| 122 |
---
|
| 123 |
|
|
|
|
| 128 |
- **Output (track-ID track):** set of `target_track_ids` (no pixels).
|
| 129 |
- **Time index:** integer `frame_id` in GT / `existence_frames`, matching `query_masks/frame_XXXXXX/`.
|
| 130 |
- **Left / right:** means **image / viewer** coordinates (left or right side of the picture), **not** the person’s anatomical left/right hand.
|
| 131 |
+
- **Query text:** prefer **not** embedding absolute frame numbers in the question (timing belongs in `temporal_profile` / anchors). “Final frame” is OK when it is part of the event description.
|
| 132 |
+
|
| 133 |
+
### Query types (A / B / C)
|
| 134 |
+
|
| 135 |
+
| Type | Count | Meaning |
|
| 136 |
+
|------|------:|---------|
|
| 137 |
+
| **A** | 37 | Spatio-temporal: target present only inside an `expected_temporal_anchor` window |
|
| 138 |
+
| **B** | 29 | Multi-object / set / except / static — usually full-span masks |
|
| 139 |
+
| **C** | 23 | Zero-target / distractor — **black on every frame** (explicit empty GT) |
|
| 140 |
|
| 141 |
### Closed object vocabulary
|
| 142 |
|
|
|
|
| 151 |
- **Inside** the anchor interval(s): normal object mask.
|
| 152 |
- **Outside** the interval: **empty / black** full-frame mask (`temporally_inactive: true`) — still listed in `frames[]`.
|
| 153 |
- **Empty interval list** (e.g. `intact: []`): the state never occurs → all frames black for that anchor.
|
| 154 |
+
- **Inclusive overlaps** are allowed when states intentionally share boundary frames (e.g. cookie `intact` / `breaking` / `broken_pieces` all include f330).
|
| 155 |
+
- **`unannotated_visible_frames`:** filled by copying / flow-warping the nearest track GT contour (`scripts/fill_unannotated_visible.py` → `_annotations_filled.coco.json`). Lists should stay empty after a successful fill.
|
| 156 |
+
- **Parent ⊃ child COCO blobs:** when a Roboflow category draws a parent that already contains a child (e.g. espresso “scale with cup”), GT subtracts the child track so scale-only queries stay scale-only (`TRACK_MASK_SUBTRACT` in `predictions_ground_truth.py`).
|
| 157 |
- **`existence_frames`:** only frames with a **positive** (non-empty) mask.
|
| 158 |
+
- Type **C** (zero-target): **explicit** empty mask+`size` on every annotated scene frame.
|
| 159 |
+
- **`excluded_frames`:** reserved for rare unfilled gaps; **current release = empty**.
|
| 160 |
|
| 161 |
Eval: both empty → IoU `1.0`; predicting an object on a black GT frame → IoU `0.0`. Models must get **both identity and timing** right.
|
| 162 |
|
|
|
|
| 171 |
- `query_id`, `scene`, `text_en`, `text_zh`
|
| 172 |
- `target_track_ids`, `target_count`
|
| 173 |
- `object_vocabulary` (closed category list for this scene)
|
| 174 |
+
- `query_type` (`A`/`B`/`C`), `requires_motion_understanding`
|
| 175 |
- Optional: `temporal_relation`, `expected_temporal_anchor`, `distractor`, `note`, `vocabulary_note`
|
| 176 |
|
| 177 |
Dense GT entries in `scripts/new_predictions_ground_truth_all_queries.json` add `ground_truth` with `target_tracks`, `existence_frames`, `excluded_frames`, and `frames[].masks[]` (`segmentation` RLE with `size`, optional `combined_mask_image`). Geometry in `segmentation` / PNGs is authoritative.
|
|
|
|
| 242 |
|
| 243 |
## Regenerating masks / GT (maintainers)
|
| 244 |
|
| 245 |
+
Canonical pipeline after editing scene track / query JSON:
|
| 246 |
+
|
| 247 |
```bash
|
| 248 |
+
# Optional: apply curated track/query patches (temporal windows, texts, …)
|
| 249 |
+
python scripts/_apply_audit_fixes.py
|
| 250 |
|
| 251 |
+
# Optional: fill any remaining unannotated_visible gaps into COCO + track map
|
| 252 |
+
python scripts/fill_unannotated_visible.py
|
| 253 |
+
|
| 254 |
+
# Rebuild 89-query dense GT
|
| 255 |
python scripts/predictions_ground_truth.py --all-queries \
|
| 256 |
--output scripts/new_predictions_ground_truth_all_queries.json
|
| 257 |
|
| 258 |
+
# Optional 36-query subset
|
| 259 |
+
python scripts/predictions_ground_truth.py \
|
| 260 |
+
--output scripts/new_predictions_ground_truth_final.json
|
| 261 |
+
|
| 262 |
+
# Write query_masks / query_masks_36 PNGs + path fields
|
| 263 |
+
python scripts/enrich_ground_truth_with_mask_images.py \
|
| 264 |
+
--input scripts/new_predictions_ground_truth_all_queries.json \
|
| 265 |
+
--output scripts/new_predictions_ground_truth_all_queries_with_paths.json \
|
| 266 |
+
--out-per-scene --frame-first-combined --scene-out-name query_masks
|
| 267 |
+
python scripts/enrich_ground_truth_with_mask_images.py \
|
| 268 |
+
--input scripts/new_predictions_ground_truth_final.json \
|
| 269 |
+
--output scripts/new_predictions_ground_truth_final_with_paths.json \
|
| 270 |
+
--out-per-scene --frame-first-combined --scene-out-name query_masks_36
|
| 271 |
+
|
| 272 |
+
# Sync evaluation/ query + track-ID files from per-scene sources
|
| 273 |
+
python scripts/_sync_eval_from_scenes.py
|
| 274 |
+
|
| 275 |
+
# Sanity: GT-as-prediction should score perfectly
|
| 276 |
+
python evaluation/evaluate_mask_temporal.py --self-check \
|
| 277 |
+
--ground-truth scripts/new_predictions_ground_truth_all_queries.json \
|
| 278 |
+
--queries-meta evaluation/R4D-Bench_queries.json
|
| 279 |
```
|
| 280 |
|
| 281 |
+
`scripts/generate_instance_masks.py` builds **per-instance** PNGs from COCO (optional; not the query-union masks used for eval).
|
| 282 |
+
|
| 283 |
---
|
| 284 |
|
| 285 |
## Relation to Segment-then-Splat & upstream data
|