habit-lance / README.md
tsmithv11's picture
Fix the Dataset Viewer with full browse tables (#2)
f658ceb
|
Raw History Blame Contribute Delete
10.2 kB
metadata
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

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

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

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

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.

hf download lance-format/habit-lance --repo-type dataset --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.

pip install lancedb==0.41.0 sentence-transformers==6.3.0 huggingface-hub==2.4.0
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(2)
    .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"])

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.

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.

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.

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.

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.

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 · Paper · License notice

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