smilegeng commited on
Commit
755add2
·
verified ·
1 Parent(s): 0508694

Add TsFile (data/), README, and meta_data (info.json + safetensors)

Browse files
.gitattributes CHANGED
@@ -58,3 +58,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
+ data/tutorial_ball_2.tsfile filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ language:
4
+ - en
5
+ pretty_name: "tutorial-ball-2 (LeRobot) — TsFile"
6
+ tags:
7
+ - time-series
8
+ - tsfile
9
+ - robotics
10
+ - lerobot
11
+ - imitation-learning
12
+ task_categories:
13
+ - time-series-forecasting
14
+ - robotics
15
+ ---
16
+
17
+ # tutorial-ball-2 (LeRobot) — TsFile
18
+
19
+ This dataset is a **lossless conversion to the [Apache TsFile](https://tsfile.apache.org/)
20
+ format** of the HuggingFace LeRobot dataset
21
+ [`notmahi/tutorial-ball-2`](https://huggingface.co/datasets/notmahi/tutorial-ball-2):
22
+ a low-dimensional robot tutorial trajectory dataset (**no video**).
23
+
24
+ ## Original dataset
25
+
26
+ - **Source dataset**: [notmahi/tutorial-ball-2](https://huggingface.co/datasets/notmahi/tutorial-ball-2)
27
+ - **Format**: early LeRobot format (`meta_data/` + safetensors)
28
+ - **Content**: purely numeric low-dimensional state/action trajectories —
29
+ **314,074 frames / 751 episodes / 30 fps**. No images or video
30
+ (`meta_data/info.json`: `video=0`).
31
+
32
+ ## What is in this repository
33
+
34
+ ```
35
+ data/
36
+ └── tutorial_ball_2.tsfile # numeric time-series (converted)
37
+ meta_data/
38
+ ├── info.json # original fps/video flags + tsfile_conversion notes
39
+ ├── stats.safetensors # per-feature statistics (copied verbatim)
40
+ └── episode_data_index.safetensors # episode boundaries (copied verbatim)
41
+ ```
42
+
43
+ ## TsFile storage mapping (table model)
44
+
45
+ | Role | Column(s) | Type | Notes |
46
+ |------|-----------|------|-------|
47
+ | **TAG** | `episode_id` | STRING | `episode_{episode_index}`, 751 devices (one per episode) |
48
+ | **Time** | `round(frame_index * 1000 / 30)` ms | INT64 (ms) | 30 fps; frame_index restarts at 0 each episode |
49
+ | **FIELD** | `state_0` … `state_3` | FLOAT | `observation.state[4]` expanded |
50
+ | **FIELD** | `action_0`, `action_1` | FLOAT | `action[2]` expanded |
51
+ | **FIELD** | `episode_index`, `frame_index`, `sample_index` | INT64 | indices (`index` → `sample_index`) |
52
+ | **FIELD** | `episode_timestamp_s` | FLOAT | (`timestamp`) |
53
+ | **FIELD** | `next_done` | BOOLEAN | (`next.done`) |
54
+
55
+ ## Conversion notes
56
+
57
+ - **Purely numeric** — the source has no images or video, so only `data/` is
58
+ converted; nothing else needed.
59
+ - **TAG = `episode_id`** (751 devices). **Time = `round(frame_index × 1000/30)` ms**.
60
+ Because `frame_index` restarts at 0 within each episode and is strictly increasing,
61
+ and `round(k × 1000/30)` is also strictly increasing in `k` (step ≥ 33 ms), every
62
+ device's time axis is strictly increasing — no de-duplication or offset needed.
63
+ (30 fps gives a ~33.333 ms frame interval; with millisecond precision the per-frame
64
+ times are 0, 33, 67, 100, … — consecutive and collision-free.)
65
+ - **Array columns expanded**: `observation.state[4]` → `state_0..state_3`,
66
+ `action[2]` → `action_0..action_1` (FLOAT, matching the source float32).
67
+ - **Column names** with dots made TsFile-safe (`next.done` → `next_done`, …).
68
+ - **No columns dropped, no rows dropped**: all 314,074 frames preserved.
69
+ - `meta_data/` (info / stats / episode index) is copied over; `info.json` gains a
70
+ `tsfile_conversion` block describing the table layout.
71
+
72
+ ## Usage
73
+
74
+ ```python
75
+ from tsfile import TsFileReader
76
+
77
+ reader = TsFileReader("data/tutorial_ball_2.tsfile")
78
+ schemas = reader.get_all_table_schemas()
79
+ tname = next(iter(schemas))
80
+
81
+ cols = ["episode_id", "state_0", "state_1", "action_0", "action_1"]
82
+ with reader.query_table(tname, cols, batch_size=65536) as rs:
83
+ while (batch := rs.read_arrow_batch()) is not None:
84
+ df = batch.to_pandas()
85
+ # ... process ...
86
+ reader.close()
87
+ ```
88
+
89
+ ## Citation
90
+
91
+ ```bibtex
92
+ @misc{tutorial_ball_2,
93
+ title = {tutorial-ball-2 (LeRobot)},
94
+ author = {notmahi},
95
+ url = {https://huggingface.co/datasets/notmahi/tutorial-ball-2},
96
+ publisher = {Hugging Face}
97
+ }
98
+ ```
99
+
100
+ The source HuggingFace dataset does not declare an explicit license.
data/tutorial_ball_2.tsfile ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9bd1672550b102f91d2f56c371923b260c64b2160a060068c6c9b677984fd9a
3
+ size 6199765
meta_data/episode_data_index.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1a6e7b7ca41d3ee170e91b7fc8dbf0cbbff243bcc9179a2704bae225c046a96f
3
+ size 12152
meta_data/info.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fps": 30,
3
+ "video": 0,
4
+ "tsfile_conversion": {
5
+ "data_format": "tsfile",
6
+ "data_path": "data/tutorial_ball_2.tsfile",
7
+ "note": "data/ converted from the original LeRobot parquet to a single Apache TsFile. No video (video=0).",
8
+ "tsfile_table_name": "tutorial_ball_2",
9
+ "time_column": "Time",
10
+ "time_unit": "ms",
11
+ "time_definition": "round(frame_index * 1000/30) ms (30 fps); frame_index restarts per episode",
12
+ "tag_columns": [
13
+ "episode_id"
14
+ ],
15
+ "tag_definition": "episode_id = \"episode_{episode_index}\", one device per episode",
16
+ "column_mapping": {
17
+ "observation.state[4]": [
18
+ "state_0",
19
+ "state_1",
20
+ "state_2",
21
+ "state_3"
22
+ ],
23
+ "action[2]": [
24
+ "action_0",
25
+ "action_1"
26
+ ],
27
+ "timestamp": "episode_timestamp_s",
28
+ "next.done": "next_done",
29
+ "index": "sample_index"
30
+ }
31
+ }
32
+ }
meta_data/stats.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3e83fc308516d7c042d55add3f0dfe2cf3e061e43453d3b061336e0fd88fed6
3
+ size 2112