Datasets:

smilegeng commited on
Commit
30e9fae
·
verified ·
1 Parent(s): a7c40ee

Use per-episode TsFile layout matching LeRobot data_path

Browse files
README.md CHANGED
@@ -2,7 +2,7 @@
2
  license: other
3
  language:
4
  - en
5
- pretty_name: "Vacuame/train4 (LeRobot SO-100) — TsFile"
6
  tags:
7
  - time-series
8
  - tsfile
@@ -15,79 +15,85 @@ task_categories:
15
  - robotics
16
  ---
17
 
18
- # Vacuame/train4 (LeRobot SO-100) — TsFile
19
 
20
- This dataset converts the numeric time-series of the HuggingFace LeRobot dataset
21
- [`Vacuame/train4`](https://huggingface.co/datasets/Vacuame/train4)
22
- **losslessly to the [Apache TsFile](https://tsfile.apache.org/) format**, and keeps
23
- the original camera videos alongside.
24
 
25
- ## Original dataset
26
 
27
- - **Source dataset**: [Vacuame/train4](https://huggingface.co/datasets/Vacuame/train4)
28
- - **Format**: LeRobot v2.0 (robot_type = `so100`)
29
- - **Content**: a small SO-100 robot-arm manipulation dataset — **119 frames /
30
- 2 episodes / 30 fps**, 1 task ("try"), with two RGB camera streams
31
- (`laptop`, `phone`).
 
 
 
 
 
 
 
 
 
 
32
 
33
- ## What is in this repository
 
 
 
 
 
 
 
34
 
 
 
 
 
 
35
  ```
36
- data/
37
- └── vacuame_train4.tsfile # numeric time-series (converted)
38
- videos/
39
- └── chunk-000/
40
- ├── observation.images.laptop/episode_0000{00,01}.mp4 # copied verbatim
41
- └── observation.images.phone/episode_0000{00,01}.mp4 # copied verbatim
42
- meta/
43
- ├── info.json # original LeRobot info + tsfile_conversion notes
44
- ├── tasks.jsonl # copied verbatim
45
- ├── episodes.jsonl # copied verbatim
46
- └── stats.json # copied verbatim
47
  ```
48
 
49
- ## TsFile storage mapping (table model)
50
-
51
- | Role | Column(s) | Type | Notes |
52
- |------|-----------|------|-------|
53
- | **TAG** | `episode_id` | STRING | `episode_{episode_index}`, 2 devices (one per episode) |
54
- | **Time** | `round(frame_index * 1000 / 30)` ms | INT64 (ms) | 30 fps; frame_index restarts at 0 each episode |
55
- | **FIELD** | `state_0` … `state_5` | FLOAT | `observation.state[6]` expanded |
56
- | **FIELD** | `action_0` … `action_5` | FLOAT | `action[6]` expanded |
57
- | **FIELD** | `episode_index`, `frame_index`, `sample_index`, `task_index` | INT64 | indices (`index` → `sample_index`) |
58
- | **FIELD** | `episode_timestamp_s` | FLOAT | (`timestamp`) |
59
-
60
- ## Conversion notes
61
-
62
- - **Only the numeric time-series is converted**. The `observation.images.*` features
63
- are videos in LeRobot — their pixels live in the MP4 files under `videos/`, which
64
- are kept verbatim here.
65
- - **TAG = `episode_id`** (2 devices). **Time = `round(frame_index × 1000/30)` ms**.
66
- Because `frame_index` restarts at 0 within each episode and is strictly increasing,
67
- every device's time axis is strictly increasing — no de-duplication or offset needed.
68
- - **Array columns expanded**: `observation.state[6]` → `state_0..state_5`,
69
- `action[6]` → `action_0..action_5` (FLOAT, matching the source float32).
70
- - **Column names** with dots are made TsFile-safe (`next.*` etc.).
71
- - **No columns dropped, no rows dropped**: all 119 frames preserved (episode 0: 87,
72
- episode 1: 32). The source data is one parquet per episode; they are merged on read.
73
-
74
- ## Usage
75
-
76
- ```python
77
- from tsfile import TsFileReader
78
-
79
- reader = TsFileReader("data/vacuame_train4.tsfile")
80
- schemas = reader.get_all_table_schemas()
81
- tname = next(iter(schemas))
82
-
83
- cols = ["episode_id", "state_0", "action_0", "task_index"]
84
- with reader.query_table(tname, cols, batch_size=65536) as rs:
85
- while (batch := rs.read_arrow_batch()) is not None:
86
- df = batch.to_pandas()
87
- # ... process ...
88
- reader.close()
89
  ```
90
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  ## Citation
92
 
93
  ```bibtex
 
2
  license: other
3
  language:
4
  - en
5
+ pretty_name: "Vacuame/train4 (LeRobot SO-100) - TsFile"
6
  tags:
7
  - time-series
8
  - tsfile
 
15
  - robotics
16
  ---
17
 
18
+ # Vacuame/train4 (LeRobot SO-100) - TsFile
19
 
20
+ This dataset converts the numeric time-series from [`Vacuame/train4`](https://huggingface.co/datasets/Vacuame/train4) to Apache TsFile while preserving the LeRobot episode-level layout.
 
 
 
21
 
22
+ ## Repository Layout
23
 
24
+ ```text
25
+ README.md
26
+ data/chunk-000/episode_000000.tsfile
27
+ data/chunk-000/episode_000001.tsfile
28
+ meta/info.json
29
+ meta/tasks.jsonl
30
+ meta/episodes.jsonl
31
+ meta/stats.json
32
+ videos/chunk-000/observation.images.laptop/episode_000000.mp4
33
+ videos/chunk-000/observation.images.laptop/episode_000001.mp4
34
+ videos/chunk-000/observation.images.phone/episode_000000.mp4
35
+ videos/chunk-000/observation.images.phone/episode_000001.mp4
36
+ ```
37
+
38
+ ## Source Dataset
39
 
40
+ - Source: [`Vacuame/train4`](https://huggingface.co/datasets/Vacuame/train4)
41
+ - LeRobot version: v2.0
42
+ - Robot type: `so100`
43
+ - Episodes: 2
44
+ - Frames: 119
45
+ - FPS: 30
46
+ - Task: `try`
47
+ - Video streams: `observation.images.laptop`, `observation.images.phone`
48
 
49
+ The original source data is one Parquet file per episode:
50
+
51
+ ```text
52
+ data/chunk-000/episode_000000.parquet
53
+ data/chunk-000/episode_000001.parquet
54
  ```
55
+
56
+ The converted data keeps the same episode granularity:
57
+
58
+ ```text
59
+ data/chunk-000/episode_000000.tsfile
60
+ data/chunk-000/episode_000001.tsfile
 
 
 
 
 
61
  ```
62
 
63
+ ## TsFile Mapping
64
+
65
+ - Table name: `vacuame_train4`
66
+ - TAG columns: `episode_id`, `task_id`
67
+ - Time precision: milliseconds
68
+ - Time definition: `round(frame_index * 1000 / 30)`
69
+ - `timestamp` is preserved as `episode_timestamp_s`
70
+ - `index` is renamed to `sample_index`
71
+ - `observation.state[6]` is flattened to `state_0` ... `state_5`
72
+ - `action[6]` is flattened to `action_0` ... `action_5`
73
+ - Row count preserved: 119 source rows -> 119 TsFile rows across 2 files
74
+
75
+ ## Video Alignment
76
+
77
+ Videos are not stored inside TsFile. They are mirrored under `videos/` and aligned by episode and frame:
78
+
79
+ ```text
80
+ data/chunk-000/episode_000000.tsfile
81
+ videos/chunk-000/observation.images.laptop/episode_000000.mp4
82
+ videos/chunk-000/observation.images.phone/episode_000000.mp4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  ```
84
 
85
+ Within an episode, `frame_index` aligns with the video frame index, and `episode_timestamp_s` aligns with video time in seconds.
86
+
87
+ ## Metadata
88
+
89
+ `meta/info.json` has been updated so:
90
+
91
+ ```json
92
+ "data_path": "data/chunk-{episode_chunk:03d}/episode_{episode_index:06d}.tsfile"
93
+ ```
94
+
95
+ It also includes a `tsfile_conversion` object documenting the source path, converted path, TAG columns, time mapping, row count, and vector flattening.
96
+
97
  ## Citation
98
 
99
  ```bibtex
data/chunk-000/episode_000000.tsfile ADDED
Binary file (2.85 kB). View file
 
data/chunk-000/episode_000001.tsfile ADDED
Binary file (2.7 kB). View file
 
meta/info.json CHANGED
@@ -11,7 +11,7 @@
11
  "splits": {
12
  "train": "0:2"
13
  },
14
- "data_path": "data/vacuame_train4.tsfile",
15
  "video_path": "videos/chunk-{episode_chunk:03d}/{video_key}/episode_{episode_index:06d}.mp4",
16
  "features": {
17
  "action": {
@@ -125,37 +125,24 @@
125
  }
126
  },
127
  "tsfile_conversion": {
128
- "data_format": "tsfile",
129
- "note": "data/ converted from the original LeRobot parquet (one-per-episode, merged) to a single Apache TsFile. Videos kept verbatim under videos/.",
130
- "tsfile_table_name": "vacuame_train4",
131
- "time_column": "Time",
132
- "time_unit": "ms",
133
- "time_definition": "round(frame_index * 1000/30) ms (30 fps); frame_index restarts per episode",
134
  "tag_columns": [
135
- "episode_id"
 
136
  ],
137
- "tag_definition": "episode_id = \"episode_{episode_index}\", one device per episode",
138
- "column_mapping": {
139
- "observation.state[6]": [
140
- "state_0",
141
- "state_1",
142
- "state_2",
143
- "state_3",
144
- "state_4",
145
- "state_5"
146
- ],
147
- "action[6]": [
148
- "action_0",
149
- "action_1",
150
- "action_2",
151
- "action_3",
152
- "action_4",
153
- "action_5"
154
- ],
155
- "timestamp": "episode_timestamp_s",
156
- "index": "sample_index",
157
- "observation.images.laptop": "kept as video under videos/ (not in tsfile)",
158
- "observation.images.phone": "kept as video under videos/ (not in tsfile)"
159
- }
160
- }
161
- }
 
11
  "splits": {
12
  "train": "0:2"
13
  },
14
+ "data_path": "data/chunk-{episode_chunk:03d}/episode_{episode_index:06d}.tsfile",
15
  "video_path": "videos/chunk-{episode_chunk:03d}/{video_key}/episode_{episode_index:06d}.mp4",
16
  "features": {
17
  "action": {
 
125
  }
126
  },
127
  "tsfile_conversion": {
128
+ "source_dataset": "Vacuame/train4",
129
+ "source_data_path": "data/chunk-{episode_chunk:03d}/episode_{episode_index:06d}.parquet",
130
+ "converted_data_path": "data/chunk-{episode_chunk:03d}/episode_{episode_index:06d}.tsfile",
131
+ "table_name": "vacuame_train4",
132
+ "time_precision": "ms",
133
+ "time_column": "Time = round(frame_index * 1000 / 30)",
134
  "tag_columns": [
135
+ "episode_id",
136
+ "task_id"
137
  ],
138
+ "row_count": 119,
139
+ "episode_files": 2,
140
+ "vector_columns_flattened": {
141
+ "observation.state": "state_0..state_5",
142
+ "action": "action_0..action_5"
143
+ },
144
+ "frame_alignment": "episode_index selects the TsFile/video file; frame_index aligns with video frame index; episode_timestamp_s aligns with video time in seconds.",
145
+ "notes": "meta/ and videos/ are mirrored from the source repository; only Parquet data is converted to TsFile."
146
+ },
147
+ "source_data_path": "data/chunk-{episode_chunk:03d}/episode_{episode_index:06d}.parquet"
148
+ }