File size: 7,717 Bytes
aaf8747 | 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | # Reading training clips and recorded metadata
本次发布包含 5000 个双视角 clip,保留原始 124 帧、24 FPS 视频和原始 caption v1。每个 clip 实际为 5.166667 秒。地图、玩家操作、相机与 world state 的元数据覆盖完整 21 个 episode,可用于设计新的 proxy 表达与渲染风格。
## Retrieve one training example
Download `manifests/train.jsonl`, the desired `train/train-XXXXX.tar` shard, and the scripts in `examples/`. The manifest identifies every sample's shard, exact archive members, and SHA256 hashes. Place them in their original repository-relative locations.
```bash
python examples/extract_clip.py \
--release-root . \
--output extracted_clip
```
Without `--sample-id`, this chooses the first manifest entry. To retrieve a specific entry, pass its complete ID using `--sample-id`. The destination must be new. The script verifies all five members and writes their original names. It needs only Python's standard library.
Each example contains two videos, one caption, one alignment record, and one sample metadata record:
| Member suffix | Meaning |
|---|---|
| `.proxy.mp4` | Original proxy555 control video; compiler 5.5.1 |
| `.target.mp4` | Original paired GTA RGB target video |
| `.caption_v1.txt` | Original English caption text |
| `.alignment.json` | Output-frame to source-frame mapping for each view |
| `.json` | Portable sample identity, source, format, quality and member metadata |
Both videos are 2560 × 720 with agent_000's camera on the left and agent_001's on the right. A single clip ID is one paired dual-view training example. Keep the same left/right ownership when transforming the videos.
The TAR files are uncompressed and group samples using WebDataset-style keys. The standard-library example is the reference reader; it treats `.proxy.mp4` and `.target.mp4` as separate member types. `manifests/train.parquet`, when present, is a tabular copy of the JSONL index.
## Load with Hugging Face Datasets
The dataset card selects the 25 training TAR shards. For streaming access, use:
```python
from datasets import Video, load_dataset
ds = load_dataset(
"iapple1/CoCode-World-Data", "train", split="train", streaming=True
)
ds = ds.cast_column("proxy.mp4", Video(decode=False))
ds = ds.cast_column("target.mp4", Video(decode=False))
example = next(iter(ds))
print(example["__key__"])
print(example["caption_v1.txt"])
proxy_bytes = example["proxy.mp4"]["bytes"]
target_bytes = example["target.mp4"]["bytes"]
```
The explicit casts expose video bytes without requiring a decoder. A local equivalent using the released TAR files was tested with Datasets 4.4.1: first and last shards each yielded 200 examples, and a combined cross-episode stream yielded 400. Multi-dot member fields remain distinct. That version initially infers videos as binary columns, so retain the casts when video feature typing is needed. Hub viewer conversion and automatic video previews depend on the service environment and are not part of the local verification.
## Caption method identity
The release preserves **caption method v1**: an overall summary, a left-view timeline, and a right-view timeline. The public annotation schema is named caption-v1. No caption text was rewritten during packaging.
The reference prompt is [caption_v1_prompt.txt](caption_v1_prompt.txt). Internal model names and annotation labels were normalized for public distribution. The original generated caption text remains unchanged. The public prompt SHA256 is:
```text
57c1f2626720344b12d3f67a424929c574addac3425a9d1dabaa8d8edd4e0239
```
The captioning procedure samples RGB at 4 FPS plus the last frame, with three proxy anchors per view. Captions and automated quality labels can contain errors; this release does not claim a complete human review. Caption times such as `5.17s` correspond to the preserved 124-frame clip.
## Extract the metadata you need
The metadata catalog lists archive paths, sizes, checksums, and coverage. Extract map and episode archives beneath one directory, called `source` here. Archives preserve the original relative directory structure, including hidden `.spool` directories.
```bash
mkdir -p source
tar -xzf metadata/maps/scene_001.tar.gz -C source
tar -xzf metadata/episodes/episode_001.tar.gz -C source
```
Replace `episode_001` using the selected manifest row's `source.episode`. The archive path is also recorded in the row's metadata references. Keep the portable `metadata/source_index/global_index.sqlite3` beside the release. Full original RGB recordings and full-length proxy videos are not part of the metadata archive; their source identities remain in the scientific provenance.
## Trace a clip frame to its recorded observations
For output frame `i`, the alignment's `left[i]` and `right[i]` entries contain source `frame_id` values. Those primary keys join to `frames.frame_id` in the global SQLite index. The joined `segment_id` identifies the episode, camera owner, and metadata directory.
```bash
python examples/inspect_frame.py \
--index metadata/source_index/global_index.sqlite3 \
--source-root source \
--alignment extracted_clip/clip_000001.alignment.json \
--side left --frame 0 --records \
--output frame_record.json
```
`--records` scans the episode's raw streams. Large episodes take longer; omit it to inspect only the index, scene path, and per-frame rendering provenance. The output includes the recorded world snapshot and any directly matching client observations, including their `action`, `camera`, `agent_state`, and availability fields. When multiple client rows match, the script reports all of them instead of silently selecting one.
The joins preserve distinct identities:
- `frame_id` identifies a source frame in the release index.
- `segment_id` plus `proxy_frame_index` identifies a frame in its published source segment.
- `source_id` plus `rgb_decode_index` identifies the decoded frame in the original recording source.
- `world_capture_tick` maps to the world stream's `sample_seq` within the episode and server clock domain.
- Client matching uses the recorded render frame or client sample identity and its clock domain; legacy rows may use `sample_seq_estimate`.
Do not join cameras by equal local frame indices. The 24 FPS clip grid may reuse a source frame, especially for older recordings at lower native FPS. Cross-view timing remains an estimate: original nearest matches allow up to 75 ms and can be many-to-one. Camera interpolation, vehicle interpolation, and occupant smoothing are explicitly recorded derived operations. The matching raw control row is an observation, not an interpolated input command.
## Reuse controls and world state
Raw client rows are under `<episode-relative>/.spool/agents/<agent_id>/client.jsonl`. Controls include forward/right motion, look deltas, action buttons, and keyboard/mouse aggregates. Preserve `pressed`, `released`, and `held` separately. Honor `action.availability`; absent data must not be treated as a measured zero. These controls are sampled/aggregated observations, not a complete stream of operating-system input events.
World rows are under `<episode-relative>/.spool/world_state.jsonl`. They record observed agents, vehicles, pedestrians, objects, environment, and lifecycle information. Completeness and availability fields are part of the data. This is an observable world-state sequence, not a complete engine save or all internal AI state.
See [`RENDERING.md`](RENDERING.md) for creating a new proxy visualization from recorded trajectories. Editing controls alone does not produce new physically consistent trajectories; that requires a simulator or a learned dynamics model.
|