File size: 5,925 Bytes
1893df2 | 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 | # Reading RoboInF-4K
`manifests/train.jsonl` and `manifests/val.jsonl` index 2,520 training and 861 validation demonstrations. Each row records its task, instruction, scene ID and seed, requested control conditions, recorded success, clock validity, duration, and sample and transition counts. The unique `episode_uid` has the form `task/split/episode_id`. IDs can repeat across tasks or splits.
Download a manifest and its selected shards. The `shard` field gives the relative path under `data/`. Each uncompressed tar shard holds up to 64 episodes; member names begin with `episode_id/`. The corresponding files under `contacts/`, `masks/`, `jpeg/` and `terminal_rgb/` use the same task and shard filename. To read a place-bottle episode and its first head-camera image:
```bash
python -m pip install huggingface_hub numpy h5py pillow
hf download JGuo666/RoboInF-4K --repo-type dataset --local-dir . --include 'examples/read_episode.py' 'manifests/train.jsonl' 'data/place_bottle/train-000.tar' 'jpeg/place_bottle/train-000.tar' 'terminal_rgb/place_bottle/train-000.tar'
python examples/read_episode.py --root . --split train --task place_bottle --camera head --frame 0
```
| Archive | Episode member | Contents |
| --- | --- | --- |
| `data/` | `episode.json` | Episode header and requested control conditions |
| `data/` | `trajectory.hdf5` | Robot states, action targets, physical clock, moving-camera calibration and tracked keypoints |
| `data/` | `annotations.json.gz` | Actor ID dictionary, ordered keypoint names and task-specific arm, bounding-box, pose, target and requested-contact annotations |
| `contacts/` | `contacts.parquet` | Observed contact events. Read with a Parquet library such as PyArrow |
| `masks/` | `segmentation.npz` | Integer instance/link IDs, shaped `[N,240,320]` for each camera. Use `numpy.load(..., allow_pickle=False)` |
| `jpeg/` | `<camera>.mjpg`, `<camera>.offsets.npy` | Original JPEG images for samples 0 through N−2 and their byte offsets |
| `terminal_rgb/` | `<camera>.png` | Last observation (sample N−1), decoded from the source video as 8-bit RGB and stored losslessly |
The four RGB names are `head`, `front`, `left_wrist` and `right_wrist`. The first N−1 images preserve the exact JPEG bytes in the native trajectory. The terminal sample was only available in video; PNG preserves its decoded RGB pixels without further lossy re-encoding. The two encodings can differ slightly in appearance. Test scenes have no image shards.
For random access, read `<camera>.offsets.npy` as a length-N array of little-endian uint64 byte offsets. For sample i < N−1, decode precisely the bytes in `<camera>.mjpg[offsets[i]:offsets[i+1]]` using a JPEG decoder. Sample N−1 is the separate PNG. The example supports `--frame -1` for this last sample and returns a `uint8[240,320,3]` RGB array from `read_rgb()`. Use the HDF5 clock for the timestamp of either encoding.
## Shapes and physical time
For an episode with `N` samples, `time/frame_index`, `time/sim_step`, `time/time_sec` and `time/physical_time_valid` in the HDF5 file have length `N`. The native robot `state/` and `action/` groups have `N-1` rows. At transition `i`, the state refers to observation sample `i` and the action is a target at sample `i+1`; `time/observation_frame_index` and `time/action_frame_index` make this explicit. There is no terminal action. The `instructions` scalar matches the human-readable instruction in the manifest.
For each arm, `left_` or `right_`, the suffixes are `arm_joint_states` (6 joint coordinates), `ee_joint_states` (1 gripper coordinate) and `ee_poses` (7 coordinates). The records do not represent joint velocities or torque commands. Use the recorded times, not a fixed video frame rate; repeated physical steps and times are valid. `duration_sec` covers the recorded camera window and excludes unrecorded setup or settling.
`calibration/<camera>/intrinsic_cv` and `extrinsic_cv` have shape `[N,3,3]` and `[N,4,4]`. Extrinsics map world coordinates (metres) to the OpenCV camera frame. Cameras are `head_camera`, `front_camera`, `left_camera` and `right_camera`; `image_size` is ordered height, width. `keypoints/positions`, `keypoints/valid_mask` and `keypoints/confidence` align to the same samples and use the keypoint order from `annotations.json.gz`.
## Annotations
The available annotation groups depend on the task. A requested pose, region or contact specifies a condition, whereas a simulator pose or observed contact describes what actually occurred. Actor IDs are local to the scene. A projected bounding box and a visible segmentation mask do not necessarily cover the same pixels.
Contact event rows keep duplicates and physical-step events between camera samples. `position` uses the coordinate system named in `frame`, typically `sim_world`. Use `physical_sim_step` and `physical_time_sec` when `physical_time_valid` is true. A row can match zero or multiple camera samples; use `frame_indices` or the single `frame_index` when present. `capture_source`, `arm` and `gripper_link` may be null. Do not use requested conditions, future interactions or measured expert trajectories as an online policy observation.
## Evaluation inputs
`evaluation/val-cases.jsonl` and `evaluation/test-cases.jsonl` contain `case_id`, `task`, `scene_id` and the policy's natural-language `instruction`. Join them to the corresponding `*-scenes.jsonl` on **both** task and scene ID. Each split has 115 scenes and 861 cases. Train, validation and test are disjoint by scene within task.
Use the same test case and scene seed for both the standard and randomized appearance conditions. For the latter apply `test_random_appearance`: texture identifiers, ambient light, point lights, and a 64-bit unsigned seed stored as a decimal string. Parse the seed without converting to floating point. Test files contain no expert actions, recordings, judge labels or results.
|