--- license: cc-by-nc-4.0 pretty_name: AnchorReasoning language: - en size_categories: - 100K This repository contains **annotations only**. It ships no images, no sensor data and no ego > trajectories. Those come from WOD-E2E, which you must obtain separately from Waymo. Every row > here is keyed to a WOD-E2E frame so the two line up exactly. ## At a glance | | | |---|---| | Annotated frames | 416,119 | | WOD-E2E segments | 2,492 | | Decision-critical elements | 395,379 | | ... with an instance mask | 381,904 (96.6%) | | ... with a driving implication | 267,778 (67.7%) | | Frames with a rationale + action plan | 293,413 | | Element types | 19 types in 4 categories | | Total download size | 75.1 MB | ## Relationship to WOD-E2E AnchorReasoning **does not modify WOD-E2E** — not its sensor data, not its splits. It is a pure annotation layer added on top of the decoded frames. ### The join key Every row carries `frame_name`, which is **verbatim the WOD-E2E `frame.context.name`**: ``` frame_name = "00a858a5e34819152ec72183524388c8-030" └────────── segment_id ──────────┘ └─┘ frame_id ``` `segment_id` is the WOD-E2E segment (scene) id and `frame_id` is the zero-padded frame index inside it; both are also stored as their own columns. To attach an annotation to its source frame, match `frame_name` against `E2EDFrame.frame.context.name` while reading Waymo's tfrecords — this is the same string Waymo itself uses in `test_sequence_frames_for_submission_as_list.txt`. ### The pixel coordinate space All boxes and masks live in the pixel space of a **2916 x 1079 forward panorama**, not in any single Waymo camera image. The panorama is built by undistorting `FRONT_LEFT`, `FRONT` and `FRONT_RIGHT` and reprojecting all three onto **one shared virtual pinhole aligned with the vehicle axes** (x forward, y left, z up), with the focal length and principal-point height taken from that frame's `FRONT` calibration and the principal-point width at the panorama centre. Because the three cameras share a single image plane, an object seen by two cameras lands on the same panorama pixel and the seams stay continuous. That makes the mapping between panorama pixels and vehicle-frame directions a closed form: ```python # Panorama <-> vehicle frame (x forward, y left, z up). # f = FRONT camera fx (frame.context.camera_calibrations[FRONT].intrinsic[0]) # cy = FRONT camera cy (intrinsic[3]); W, H = 2916, 1079 def pixel_to_ray(u, v, f, cy, W=2916): """Panorama pixel -> unit-less direction in the vehicle frame.""" return (1.0, -(u - W / 2.0) / f, -(v - cy) / f) def ray_to_pixel(x, y, z, f, cy, W=2916): """Vehicle-frame direction (x must be > 0) -> panorama pixel.""" return (W / 2.0 - f * (y / x), cy - f * (z / x)) ``` So you can project anything in the vehicle frame (a 3D box, a LiDAR point, a planned trajectory) straight onto our boxes and masks — or go the other way, and turn a mask into a bundle of rays. To reproduce the panorama image itself from a WOD-E2E frame: ```python # Rebuilding panorama_geo.png from a WOD-E2E frame (needs opencv + numpy). import cv2, io, numpy as np from PIL import Image CAMERAS = ("FRONT_LEFT", "FRONT", "FRONT_RIGHT") W, H = 2916, 1079 # Waymo camera axes (x out of lens, y left, z up) -> pinhole axes (x right, y down, z forward) P = np.array([[0, -1, 0], [0, 0, -1], [1, 0, 0]], dtype=np.float64) def build_panorama(images, calibs): """images/calibs: dicts keyed by camera name, from one E2EDFrame.""" f = calibs["FRONT"].intrinsic[0] cx_p, cy_p = W / 2.0, calibs["FRONT"].intrinsic[3] uu, vv = np.meshgrid(np.arange(W), np.arange(H)) std = np.stack([(uu - cx_p) / f, (vv - cy_p) / f, np.ones_like(uu)], -1) ray = std @ np.linalg.inv(P).T # vehicle-frame rays ray /= np.linalg.norm(ray, axis=-1, keepdims=True) out = np.zeros((H, W, 3), np.uint8) best = np.full((H, W), -1.0) # keep the most on-axis camera for cam in CAMERAS: c, src = calibs[cam], images[cam] h, w = src.shape[:2] fx, fy, cx, cy = c.intrinsic[:4] K = np.array([[fx, 0, cx], [0, fy, cy], [0, 0, 1]]) undist = cv2.undistort(src, K, np.array(c.intrinsic[4:9]), None, K) R = np.array(c.extrinsic.transform).reshape(4, 4)[:3, :3] d = ray @ R # ray in this camera's frame depth = d[..., 0] s = d @ P.T us = fx * s[..., 0] / s[..., 2] + cx vs = fy * s[..., 1] / s[..., 2] + cy ok = (depth > 1e-6) & (us >= 0) & (us < w) & (vs >= 0) & (vs < h) & (depth > best) sampled = cv2.remap(undist, np.where(ok, us, -1).astype(np.float32), np.where(ok, vs, -1).astype(np.float32), cv2.INTER_LINEAR) out[ok], best[ok] = sampled[ok], depth[ok] return Image.fromarray(out) ``` ## Splits | Split | Frames | Segments | Elements | Notes | |---|---|---|---|---| | train | 415,663 | 2,037 | 394,722 | 21 batches (p1-p21) | | validation | 456 | 455 | 657 | WOD-E2E rater-feedback frames | **train** covers every decoded frame of the WOD-E2E training segments. **validation** is deliberately small and targeted: it is exactly the set of frames for which WOD-E2E publishes **rater-feedback trajectories**, i.e. the frames on which the official Rater Feedback Score (RFS) is computed. Annotating those frames lets you score grounding, reasoning and planning on the same frames the official trajectory metric uses. The remaining decoded validation frames are not annotated, and the WOD-E2E **test** split is not annotated at all. ## Dataset structure Two configs, both keyed by `frame_name`, both split into `train` / `validation`. ### `annotations` (default) — the VG-CoT One row per annotated frame. | Column | Type | Description | |---|---|---| | `frame_name` | string | `-`; equals WOD-E2E `frame.context.name` | | `segment_id` | string | WOD-E2E segment id (32 hex chars) | | `frame_id` | string | Zero-padded frame index within the segment | | `partition` | string | Annotation batch (`p1`-`p21`); `rater_feedback` on validation | | `image_width` / `image_height` | int32 | Panorama size the boxes refer to (2916 x 1079) | | `context` | struct | `weather`, `daytime`, `visibility`, `scenario`, `road` | | `traffic_events` | list<string> | Scene-level events; empty when none apply | | `elements` | list<struct> | Decision-critical elements, see below | | `rationale` | string | Frame-level reasoning that integrates the elements | | `action_plan` | string | Short-horizon lateral + longitudinal plan in free text | Each entry of `elements`: | Field | Type | Description | |---|---|---| | `element_id` | string | Per-frame instance id, e.g. `vehicle 1`; joins to the `masks` config | | `category` | string | `vehicle`, `vulnerable user`, `traffic control`, `obstacle` | | `type` | string | Fine-grained type, e.g. `Car`, `Pedestrian`, `Traffic light` | | `impact_rank` | int32 | 1 = strongest influence on the current decision | | `bbox` | struct<x,y,w,h> | Panorama pixels, top-left corner + size | | `location` | string | Relative bearing + road topology, e.g. `front left in the oncoming lane` | | `state` | list<string> | Observed condition, e.g. `stopping`, `cruising` | | `intention` | list<string> | Likely short-term behaviour, e.g. `crossing`, `left turn` | | `content` | list<string> | Traffic-control semantics, e.g. `red`, `stop` | | `description` | string | Free text for `Other` / `Temporary control` / `Animal` | | `implication` | string | How this element constrains the ego vehicle | | `has_mask` | bool | Whether the `masks` config carries a mask for this element | Attributes are conditioned on `category`: vehicles, vulnerable users and obstacles carry `location` / `state` / `intention`; traffic-control elements carry `content`. Fields that do not apply are `null` rather than empty. ### `masks` — pixel grounding One row per annotated frame that has at least one mask, with a `masks` list whose `element_id` joins back to `annotations.elements`. | Field | Type | Description | |---|---|---| | `element_id` | string | Joins to `annotations.elements[].element_id` | | `type` / `category` | string | Copied from the COCO category, e.g. `vehicle:Car` | | `bbox` | struct<x,y,w,h> | Same box as in `annotations` | | `area` | int64 | Mask area in pixels | | `rle_counts` | string | COCO **compressed** RLE, `size = [image_height, image_width]` | ## Usage ```python from datasets import load_dataset # structured reasoning annotations (default config) ann = load_dataset("hzxbzp/AnchorReasoning", "annotations", split="train") # instance masks for the same frames masks = load_dataset("hzxbzp/AnchorReasoning", "masks", split="train") print(ann[0]["frame_name"]) # "00a858a5e34819152ec72183524388c8-030" print(ann[0]["elements"][0]["type"], ann[0]["elements"][0]["implication"]) ``` ```python # Join the two configs on frame_name, then elements on element_id. by_frame = {r["frame_name"]: r for r in masks} row = ann[0] mrow = by_frame.get(row["frame_name"]) mask_of = {m["element_id"]: m for m in (mrow["masks"] if mrow else [])} for e in row["elements"]: m = mask_of.get(e["element_id"]) # None when e["has_mask"] is False print(e["element_id"], e["type"], e["impact_rank"], "mask" if m else "bbox only") ``` ```python from pycocotools import mask as mask_utils m = masks[0]["masks"][0] rle = {"size": [masks[0]["image_height"], masks[0]["image_width"]], "counts": m["rle_counts"].encode("ascii")} binary = mask_utils.decode(rle) # (1079, 2916) uint8, 1 = element assert tuple(mask_utils.toBbox(rle)) == (m["bbox"]["x"], m["bbox"]["y"], m["bbox"]["w"], m["bbox"]["h"]) ``` ```python # Reasoning text (implication / rationale / action_plan) exists from p7 onward. with_reasoning = ann.filter(lambda r: r["rationale"] is not None) # Frames whose elements are all mask-grounded fully_grounded = ann.filter(lambda r: r["elements"] and all(e["has_mask"] for e in r["elements"])) ``` ## Annotation taxonomy and statistics All counts below are computed from the released files. ### Scene context | Field | Most frequent values | |---|---| | weather | `Sunny` 48.6%, `Fair` 26.9%, `Cloudy` 18.6%, `Rainy` 4.4%, `Fog` 1.5% | | daytime | `Day` 68.7%, `Night` 31.3% | | visibility | `Clear` 67.6%, `Reduced` 16.9%, `Limited` 10.6%, `Poor` 4.9% | | scenario | `Urban` 42.0%, `Suburban Residential` 20.7%, `Urban Residential` 16.8%, `Suburban` 13.7%, `Urban Highway` 2.3%, `Unknown` 1.1% | | road | `Mid-block` 61.2%, `Intersection` 38.5%, `Diverge` 0.2%, `Merge` 0.1%, `Roundabout` 0.0% | `Fair` marks frames where no adverse weather was labelled, as distinct from an explicitly sunny sky. `scenario` keeps the raw annotation strings, which include a few near-duplicate spellings; normalise it before using it as a closed label set. ### Traffic events 186,056 frames (44.7%) carry at least one event. | Event | Count | Share | |---|---|---| | Roadside parking | 138,952 | 57.6% | | Construction | 38,279 | 15.9% | | Lane guiding | 31,466 | 13.0% | | Lane closure | 27,116 | 11.2% | | Partially occupied lane | 3,556 | 1.5% | | Road closure | 1,285 | 0.5% | | Accident | 324 | 0.1% | | Traffic jam | 199 | 0.1% | | Traffic signal malfunction | 114 | 0.0% | ### Element categories and types | Category | Elements | Share | |---|---|---| | vehicle | 198,534 | 50.2% | | traffic control | 161,332 | 40.8% | | vulnerable user | 32,080 | 8.1% | | obstacle | 3,433 | 0.9% | | Type | Elements | Share | |---|---|---| | Car | 180,676 | 45.7% | | Traffic light | 89,739 | 22.7% | | Sign | 54,206 | 13.7% | | Pedestrian | 23,171 | 5.9% | | Truck | 12,288 | 3.1% | | Stop line | 7,015 | 1.8% | | Cyclist | 5,529 | 1.4% | | Cross walk | 5,196 | 1.3% | | Temporary control | 3,489 | 0.9% | | Object | 3,209 | 0.8% | | Bus | 2,891 | 0.7% | | Motorcyclist | 2,210 | 0.6% | | Bump | 1,687 | 0.4% | | Other | 1,193 | 0.3% | | Scooter rider | 1,102 | 0.3% | | Emergency vehicle | 710 | 0.2% | | Construction vehicle | 702 | 0.2% | | School bus | 343 | 0.1% | | Animal | 23 | 0.0% | ### Impact rank Elements are ranked by how strongly they bear on the current decision, and the distribution is deliberately top-heavy: annotators keep what materially influences the current decision rather than labelling everything visible. | Impact rank | Elements | Share | |---|---|---| | 1 | 268,406 | 67.9% | | 2 | 100,217 | 25.3% | | 3 | 21,973 | 5.6% | | 4 | 3,974 | 1.0% | | 5 | 654 | 0.2% | | 6 | 134 | 0.0% | | 7 | 21 | 0.0% | Frames carry 0.95 elements on average, and 35.7% have none at all — which makes those frames usable as negatives for "is anything decision-critical here?". The annotation guideline caps a frame at five elements; only 134 frames out of 416,119 exceed it, with 7 the most ever annotated. ### Location, state, intention, content | Field | Distinct values | Most frequent | |---|---|---| | `location` | 80 | `front in the same lane`, `front left in the oncoming lane`, `front left in the adjacent same-direction lane`, `front right in the adjacent same-direction lane`, `front right at the roadside` | | `state` | 83 | `cruising`, `stopping`, `crossing`, `parking`, `decelerating`, `accelerating`, `right turn`, `left lane change` | | `intention` | 70 | `cruising`, `stopping`, `crossing`, `parking`, `left turn`, `right turn`, `accelerating`, `left lane change` | | `content` | 165 | `green`, `red`, `stop`, `keep right`, `keep left`, `yellow`, `lane guiding`, `speed limit 25 mph` | ### Free text Implications and rationales are written to be short and decision-focused rather than descriptive: on average 29.3 words per implication and 28.2 words per rationale. | Field | Distinct phrasings | Most frequent | |---|---|---| | `action_plan` | 1,358 | `keep lane and cruise`, `keep lane and accelerate`, `stop and wait`, `keep lane and decelerate`, `decelerate and stop` | `action_plan` is a semi-open vocabulary: a handful of templates cover most frames, with a long tail of more specific plans. Treat it as text, not as a closed enum. ## Annotation completeness — read this before training The dataset was annotated in batches, and **the reasoning text was added from `p7` onward**. The earlier batches have full context, events, elements, boxes, attributes, ranks and masks, but no `implication`, `rationale` or `action_plan`. | Partition | Frames | Elements | Elements with implication | Frames with rationale | |---|---|---|---|---| | p1 | 20,231 | 20,067 | 0.0% | 0.0% | | p2 | 20,469 | 19,075 | 0.0% | 0.0% | | p3 | 20,712 | 18,654 | 0.0% | 0.0% | | p4 | 20,238 | 24,490 | 0.0% | 0.0% | | p5 | 20,356 | 20,023 | 0.0% | 0.0% | | p6 | 20,414 | 24,899 | 0.0% | 0.0% | | p7 | 20,598 | 19,016 | 99.9% | 99.9% | | p8 | 20,600 | 15,994 | 100.0% | 100.0% | | p9 | 20,426 | 15,343 | 100.0% | 100.0% | | p10 | 20,544 | 17,756 | 100.0% | 100.0% | | p11 | 20,375 | 19,349 | 100.0% | 99.9% | | p12 | 20,291 | 19,097 | 100.0% | 100.0% | | p13 | 20,199 | 21,231 | 100.0% | 100.0% | | p14 | 20,611 | 19,935 | 100.0% | 100.0% | | p15 | 20,251 | 18,409 | 100.0% | 100.0% | | p16 | 20,364 | 18,765 | 99.9% | 99.9% | | p17 | 20,239 | 16,432 | 98.6% | 99.4% | | p18 | 20,531 | 18,134 | 99.9% | 100.0% | | p19 | 20,424 | 19,800 | 99.9% | 99.9% | | p20 | 20,340 | 20,056 | 99.8% | 99.8% | | p21 | 7,450 | 8,197 | 99.6% | 99.7% | The free-text annotations for `p1`-`p6` are in progress and **will be added in a future update of this repository**. Until then, filter on `partition` (or simply on `rationale is not None`) when you need the language supervision; use everything when you only need grounding and attributes. ## How it was built A human-in-the-loop pipeline, with automatic tools used only where they were measured to be reliable: - **Scene context** is classified by a VLM from the panorama and then stabilised within each clip; 50% of frames were randomly re-checked and corrected by human annotators. - **Traffic events** are human-annotated. - **Decision-critical elements** are chosen and ranked by annotators with driving experience, following four rules: prioritise traffic control, nearby elements, moving elements, and anything likely to enter, occupy or constrain the ego vehicle's future driving space, with a guideline cap of five per frame. Every frame is cross-checked by a second annotator, with a third resolving disagreements. - **Masks** come from a promptable segmentation model driven by human point prompts; boxes are derived from the masks. - **Attributes** mix sources: humans give state and intention; a VLM gives element type, sign content and temporary-control descriptions; traffic-light colour is decided by an HSV rule inside the mask; the directional half of `location` is computed from box overlap with fixed image regions, while the road-topology half is human-annotated. - **Implications, rationales and action plans** are generated from the grounded image plus the structured annotations, routed by scene complexity between a locally hosted open model and a stronger API model, then inspected and corrected through a dedicated annotation interface. Plans are additionally checked against the future trajectory with a rule-based consistency table, and inconsistent frames are flagged for manual review. Agreement between the automatic tools and human labels was measured before large-scale use: time of day 100%, visibility 88.7%, weather 83.6%, road structure 82.3% and scenario 76.5% (7,450 frames); traffic-light state 97.8% (11,318 lights); location bearing 98.4% (4,439 objects); vehicle type 99.0% (3,720 vehicles). ## What is *not* in this repository Images, ego trajectories, navigation intent, camera calibration and rater-feedback scores all come from WOD-E2E and are not redistributed here. Download WOD-E2E from Waymo, decode the frames, and join on `frame_name`. ## License and terms The annotations in this repository are released under **[CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/)**. They are a derived work of WOD-E2E and contain no Waymo sensor data. Using them together with WOD-E2E requires you to obtain that dataset yourself and to comply with the [Waymo Open Dataset License](https://waymo.com/open/terms/) — whose non-commercial terms this license is deliberately chosen to stay consistent with. ## Citation The accompanying paper is under review; a citation will be added once it is public. ```bibtex @misc{anchorreasoning, title = {AnchorReasoning: A Visual Grounding and Causal Reasoning Dataset in Long-Tail Autonomous Driving Scenarios}, year = {2026}, note = {Under review} } ```