Datasets:
|
Download README.md from lance-format/habit-lance: direct link, hf CLI and curl.
- Browser
- Download file 12.3 kB
-
https://huggingface.co/datasets/lance-format/habit-lance/resolve/main/README.md
- Command line
-
hf download hf://datasets/lance-format/habit-lance/README.md
-
curl -L -o README.md https://huggingface.co/datasets/lance-format/habit-lance/resolve/main/README.md
12.3 kB
| pretty_name: HABIT in Lance | |
| license: cc-by-4.0 | |
| task_categories: | |
| - robotics | |
| language: | |
| - en | |
| tags: | |
| - lance | |
| - robot-manipulation | |
| - human-robot-interaction | |
| - video | |
| - information-retrieval | |
| size_categories: | |
| - 10K<n<100K | |
| configs: | |
| - config_name: full | |
| default: true | |
| data_files: | |
| - split: train | |
| path: "viewer/full/train.parquet" | |
| - config_name: sample | |
| data_files: | |
| - split: train | |
| path: "viewer/sample/train.parquet" | |
| # HABIT in Lance | |
| Find human–robot manipulation episodes by what the participants do. Each result represents one episode and includes its task, annotations, trajectory reference, and all five synchronized camera references. | |
| ## Browse on Hugging Face | |
| Browse every episode in the full and sample configurations. Each episode includes its task, outcome, camera references, and pinned links to the external-camera MP4 and the trajectory. Use the LanceDB example below to search by task and fetch matching clips. [Open the Dataset Viewer](https://huggingface.co/datasets/lance-format/habit-lance/viewer/full/train) | |
| The Dataset Viewer reads the Parquet browse tables in `viewer/`. LanceDB opens the indexed tables in `data/`. | |
| ## Key features | |
| - Search high-level tasks, robot subtasks, and documented human actions with one query. | |
| - Filter results by the documented collaboration role or task outcome. | |
| - Fetch the original MP4 for any camera and the corresponding trajectory from the pinned source. | |
| ## Splits | |
| | Source config | Official split | Lance table | Episode rows | Trajectory frames | Camera files | Trajectory files | | |
| |---|---|---|---:|---:|---:|---:| | |
| | `full` | `train` | `full` | 10,563 | 5,910,818 | 52,815 | 10,563 | | |
| | `sample` | `train` | `sample` | 60 | 35,529 | 300 | 60 | | |
| Both tables preserve the complete official configuration. The publisher’s sample is kept in its own table with its own episode indices. [Release counts and configuration](meta/info.json) | |
| ## Load with LeRobot | |
| The original `full` and `sample` configurations are available as separate Lance roots. Each keeps its original episode IDs, task IDs, frame order, and five camera recordings. The `sample` configuration is the publisher’s 60-episode subset. | |
| ```bash | |
| pip install "lerobot[lancedb]==0.7.0" lancedb==0.39.0 | |
| ``` | |
| ```python | |
| from lerobot.datasets.lerobot_dataset import LeRobotDataset | |
| repo = "lance-format/habit-lance" | |
| config = "full" # use "sample" for the publisher's 60-episode subset | |
| dataset = LeRobotDataset(repo, root=f"hf://datasets/{repo}/lerobot/{config}", episodes=[0]) | |
| item = dataset[0] | |
| print(item["task"], item["action"].shape, item["observation.images.exo_view"].shape) | |
| ``` | |
| LeRobot selects its Lance reader from the configuration’s `meta/info.json` and streams the frames and camera byte ranges over the Hub. Pass `episodes=[hit["episode_index"]]` to load a result from the matching task-search configuration. | |
| The compatibility layout adapts the original LeRobot v2.0 metadata to v3.0 and retains it under each configuration’s `meta/source-v2/`. All original MP4s remain available under `lerobot/full/videos/` and `lerobot/sample/videos/`. The full configuration’s [camera timing record](lerobot/full/camera-timing.json) lists any clips whose presentation timestamps were aligned to the declared 10 fps for LeRobot. The adjusted copies retain every encoded video packet in its original order. Both source policy-action fields remain available in the Lance frame tables as null columns. [Original HABIT source](https://huggingface.co/datasets/configinc/HABIT/tree/bae97d251907743f8fb6db7e70c61d361df4dc1e) | |
| Some source Parquet shards encode four gripper velocity fields using a different physical type. The Lance table widens float32 values to float64 exactly and unwraps singleton lists for scalar fields. The affected episodes, original types, and paths to the byte-exact source shards are recorded with the dataset. [Trajectory schema record](lerobot/full/trajectory-schema.json) | |
| ## Schema | |
| | Columns | Type | Contents | | |
| |---|---|---| | |
| | `config`, `split`, `episode_index`, `input_key` | Strings, integer, list of strings | Source configuration, official split, configuration-scoped episode ID, and original input key | | |
| | `sid`, `sub_episode_idx`, `unit_name`, `instruction_key`, `task_index` | Strings and integers | Original scenario, sub-episode, unit, instruction, and task IDs | | |
| | `tasks`, `high_level_instruction`, `low_level_instruction`, `low_level_tasks`, `robot_subtask_ids`, `task_status` | Strings and lists | Original task labels, instructions, robot steps and their catalog IDs, and outcome | | |
| | `scenario_title`, `scenario_role`, `scenario_role_source`, `human_workflow` | Strings and list of structs | Documented title, normalized and original role, and human workflow steps with original step and catalog IDs where available | | |
| | `task_detail_path`, `workflow_paths` | String and list of strings | Pinned upstream scenario document and workflow illustration paths | | |
| | `length`, `fps`, `cameras`, `trajectory` | Integer, float, list of structs, struct | Frame count, frame rate, five named camera references, and one trajectory reference. References carry a source path, byte size, and available content digests | | |
| | `search_text`, `task_embedding` | String and 384 float32 values | Search description and its normalized vector | | |
| The conversion joins episode metadata and the publisher’s task catalogs by the configuration and original task IDs, then attaches documentation by `sid`. Scenario `S7791` has no matching document in this revision. Those 114 full and one sample episodes retain their original labels and media references. Human workflow descriptions are scenario-level. Frame-level timestamps, camera alignment, and timed annotations remain available through the original trajectory. | |
| ## Pre-built indices | |
| Both tables ship a cosine `IVF_FLAT` vector index, a B-tree on `episode_index`, and bitmap indices on `scenario_role` and `task_status`. The full index has eight partitions and the sample index has one. | |
| The 384-dimensional Multilingual E5 small model encodes the scenario title and role where available, the high-level instruction, the robot subtasks, and the documented human steps. The input discards empty and repeated descriptions in source order and joins the remainder with spaces. Preprocessing prefixes the input with `passage: ` and uses a 512-token cap, attention-masked mean pooling, and L2 normalization. Queries use `query: `. The index matches the task descriptions. [Pinned model revision](https://huggingface.co/intfloat/multilingual-e5-small/tree/614241f622f53c4eeff9890bdc4f31cfecc418b3) | |
| ## Why Lance? | |
| - Random access fetches the metadata needed to locate each matching episode. | |
| - An episode’s task, subtasks, synchronized camera references, and embedding share one row. | |
| - The vector and filter indices ship with the tables. | |
| - A writable copy can add derived features for a training or evaluation run. | |
| - Indexed filters select episodes by role or outcome. | |
| - Tags pin a release snapshot for repeatable queries. | |
| ## Load with LanceDB | |
| Open the full table from the Hub to inspect its row count and indices. [LanceDB documentation](https://lancedb.com/docs) | |
| ```python | |
| import lancedb | |
| db = lancedb.connect("hf://datasets/lance-format/habit-lance/data") | |
| tbl = db.open_table("full") | |
| print(tbl.count_rows()) | |
| print(tbl.list_indices()) | |
| ``` | |
| For repeated training or heavy random access, download the Lance tables once and open `./habit-lance/data` locally. Original media is fetched using its source references. | |
| ```bash | |
| hf download lance-format/habit-lance --repo-type dataset --include "data/**" --local-dir ./habit-lance | |
| ``` | |
| ## Search | |
| Which successful episodes show a robot holding a box while a person seals it with tape? Search the task index to find the episodes, then fetch only their external-camera MP4s. Choose another camera key in `cameras` to see the same episode from that view. | |
| ```bash | |
| pip install lancedb==0.39.0 sentence-transformers==6.3.0 huggingface-hub==2.4.0 | |
| ``` | |
| ```python | |
| from pathlib import Path | |
| from shutil import copyfile | |
| import lancedb | |
| from huggingface_hub import hf_hub_download | |
| from sentence_transformers import SentenceTransformer | |
| source_repo = "configinc/HABIT" | |
| source_revision = "bae97d251907743f8fb6db7e70c61d361df4dc1e" | |
| encoder = SentenceTransformer( | |
| "intfloat/multilingual-e5-small", | |
| revision="614241f622f53c4eeff9890bdc4f31cfecc418b3", | |
| ) | |
| query = encoder.encode( | |
| "query: robot holds a box steady while a person seals it with tape", | |
| normalize_embeddings=True, | |
| ) | |
| db = lancedb.connect("hf://datasets/lance-format/habit-lance/data") | |
| tbl = db.open_table("full") | |
| hits = ( | |
| tbl.search(query, vector_column_name="task_embedding") | |
| .metric("cosine") | |
| .nprobes(4) | |
| .where("task_status = 'success'", prefilter=True) | |
| .select(["episode_index", "sid", "high_level_instruction", "cameras", "trajectory", "_distance"]) | |
| .limit(5) | |
| .to_list() | |
| ) | |
| output = Path("habit-results") | |
| output.mkdir(exist_ok=True) | |
| for hit in hits: | |
| camera = next(view for view in hit["cameras"] if view["key"] == "observation.images.exo_view") | |
| video = hf_hub_download( | |
| source_repo, camera["path"], repo_type="dataset", revision=source_revision, token=False | |
| ) | |
| copyfile(video, output / f"episode_{hit['episode_index']:06d}_exo.mp4") | |
| print(hit["episode_index"], hit["sid"], hit["high_level_instruction"], 1 - hit["_distance"]) | |
| ``` | |
| ## Curate | |
| Filter by the publisher’s Supervisor role to collect episodes in which a person oversees the robot’s task. Project the robot and human instructions for review. | |
| ```python | |
| examples = ( | |
| tbl.search() | |
| .where("scenario_role = 'Supervisor'") | |
| .select(["episode_index", "scenario_title", "low_level_tasks", "human_workflow"]) | |
| .limit(20) | |
| .to_list() | |
| ) | |
| print([row["episode_index"] for row in examples]) | |
| ``` | |
| ## Evolve | |
| Create `episode_samples` using the final section first. Derive the nominal episode duration from the original frame count and the configuration’s frame rate. | |
| ```python | |
| local = lancedb.connect("./habit-local").open_table("episode_samples") | |
| local.add_columns({"duration_seconds": "CAST(length AS DOUBLE) / fps"}) | |
| ``` | |
| ## Train | |
| Use column projection to train on the cached task embeddings. For a vision run, fetch camera references for a curated set and extract the frames needed by the model before batching. | |
| ```python | |
| from lancedb.permutation import Permutation | |
| from torch.utils.data import DataLoader | |
| local = lancedb.connect("./habit-local").open_table("episode_samples") | |
| features = Permutation.identity(local).select_columns(["episode_index", "task_embedding"]) | |
| for batch in DataLoader(features, batch_size=16): | |
| print(batch.keys()) | |
| break | |
| ``` | |
| ## Versioning | |
| Pin a published Lance version to keep the episode IDs, source references, and search index fixed across experiments. | |
| ```python | |
| print(tbl.tags.list()) | |
| pinned = db.open_table("full", version=5) | |
| print(pinned.version, pinned.count_rows()) | |
| ``` | |
| ## Materialize a subset | |
| Stream successful Collaborator episodes into a writable local table for Evolve or Train. The same version APIs also work on the local table. | |
| ```python | |
| batches = ( | |
| tbl.search() | |
| .where("scenario_role = 'Collaborator' AND task_status = 'success'") | |
| .select(["episode_index", "length", "fps", "cameras", "task_embedding"]) | |
| .to_batches() | |
| ) | |
| lancedb.connect("./habit-local").create_table("episode_samples", batches) | |
| ``` | |
| ## Source, license, and changes | |
| HABIT is by Jaehwi Song, Suchae Jeong, Byeongguk Jeon, Sungdong Kim, Minjoon Seo, Hyungmok Son, and Kimin Lee at Config and KAIST. The publisher releases the episode records, annotations, and camera recordings under CC BY 4.0. [Publisher’s HABIT release](https://config.inc/blog/260807_habit) · [Paper](https://arxiv.org/abs/2606.31682) · [License notice](LICENSE.txt) | |
| The Lance release joins metadata at the episode level, normalizes one role spelling while preserving the source label, and adds text vectors and indices. Camera and trajectory files are referenced at upstream revision `bae97d251907743f8fb6db7e70c61d361df4dc1e` and retain their original bytes. The Hub reported 173,081 downloads in the preceding 30 days on November 18, 2026. [Pinned upstream snapshot](https://huggingface.co/datasets/configinc/HABIT/tree/bae97d251907743f8fb6db7e70c61d361df4dc1e) | |