Skip to content

Clean EgoDex scenario search workflow#46

Merged
everettVT merged 25 commits into
mainfrom
codex/egodex-clean-blog-workflow
Jul 7, 2026
Merged

Clean EgoDex scenario search workflow#46
everettVT merged 25 commits into
mainfrom
codex/egodex-clean-blog-workflow

Conversation

@everettVT

Copy link
Copy Markdown
Contributor

Summary

  • replace the old EgoDex script/library/UI layout with a clean egodex package over raw HDF5 episodes
  • update the notebook to support the blog narrative: filtered ingestion, pose features, scenario queries, optional SigLIP embeddings, combined search, and segment overlay inspection
  • add focused tests and package metadata for Daft 0.7.17 HDF5 support

Validation

  • uv run --extra test pytest tests/test_egodex.py -q
  • uv run --extra lint ruff check datasets/egodex tests/test_egodex.py datasets/egodex/egodex_demo.ipynb
  • git diff --check
  • timed notebook smoke for default non-model path: ingestion, feature calculation, pose queries, bounded frame preview, and overlay

Notes

  • image embeddings use daft.functions.embed_image with post-normalization
  • text encoding remains a lazy SigLIP text tower so text queries stay in the same image/text embedding space
  • unrelated pre-existing workspace changes outside the EgoDex scope were left unstaged

Shreyas Garimella and others added 18 commits June 26, 2026 11:36
Read Apple's EgoDex through Daft's LeRobot v3 reader, precompute per-frame
geometric states + Daft-window action rates and SigLIP-2 semantic embeddings,
and serve a query UI that combines a geometric filter with semantic ranking.

Dataset is CC-BY-NC-ND: scripts contain no EgoDex data; users convert their
own licensed copy locally.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tures

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Avoids colliding with the real daft.datasets.hdf5 reader shipping in Daft soon,
and makes the conversion example self-contained (imports the local copy).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…df5File

Add the thin facade the blog/notebook import (convert -> add_state_features ->
add_skeleton_features -> embed_frames -> query) and a copy-paste egodex_demo.py
showing pose-only, text-only, and combined pose x text queries.

Switch egodex_lerobot.py to read HDF5 via Daft's native Hdf5File type (one row per
episode) instead of the vendored hdf5_example reader. Add requirements-egodex.txt.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… precompute

Drop the NumPy grip predicates (is_writing_grip / is_hammer_grip /
calibrate_grip_thresholds) from skeleton_features.py: grip detection now lives only
in the Daft layer (egodex._is_writing_grip / _is_hammer_grip as @daft.func, with
thresholds from egodex.calibrate at query time). skeleton_features stays pure NumPy
geometry.

Collapse run_pose_features.py onto the facade (read -> add_state_features ->
add_skeleton_features -> write_parquet); it now writes continuous geometry only, no
baked sc_* booleans.

Refactor query_ui.py to source its predicate/thresholds/segments/text-encoder from
the facade and read the continuous-only features, so the whole repo computes
scenarios at query time from one implementation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Build -> query walkthrough: read, add_state_features, add_skeleton_features,
embed_frames, write; then calibrate, pose query, semantic text query, overlay,
and launch the query_ui dashboard. Saved with cleared outputs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pass numpy frames directly to the SigLIP processor, run embeddings before pose features in the demo, and bump daft/gradio deps.

Co-authored-by: Cursor <cursoragent@cursor.com>
Consolidate facade and feature modules under egodex_lib/, drop vendored
readers and standalone run scripts in favor of PEP 723 demos, and update
the README and query UI for the new layout.
… cleanup

Switch HDF5 conversion to process_transforms via daft.File, add notebook
download skip logic with .data caching, use nightly Daft in PEP 723 demos,
and drop egodex_lib/__init__ in favor of direct submodule imports.
Replace the manual batch loop with from_files → process_egodex_episode →
LeRobotDatasetWriter, fix the episode struct return dtype, and restore
output-dir cleanup before writing.
Move HDF5 read + feature build into the writer UDF, switch write_lerobot to
from_glob_path over .data, and tidy the demo notebook/script.
Switch the demo to read raw EgoDex HDF5 directly via read_egodex (native
Hdf5File) instead of a LeRobot round-trip, and fix issues found while running
it end to end:
- _decode_sibling_mp4: strip Daft's file:// URI scheme before av.open
- SiglipEmbedder.embed_image: guard empty batches (HF processor does
  images[0].device and errors on [])
- overlay: glob with recursive=True so `**` matches nested dirs and
  episode_index ordering matches read_egodex

Rewrite README for the egodex_lib/ layout and the raw-HDF5 pipeline, with a
note on Daft laziness and the explode barrier.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…eline

Reconcile with Everett's EgoDexLeRobotDatasetWriter commit. The two branches
took different directions in convert_egodex_to_lerobot.py (LeRobot-writer vs
raw-HDF5 read_egodex); keep the read_egodex pipeline, notebook, demo.py, and
README from this branch. Everett's writer refactor stays reachable in history,
and his egodex_video.py formatting is preserved.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1480b1dd89

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread datasets/egodex/features.py Outdated
Comment on lines +109 to +110
sums = np.convolve(values, kernel, mode="same")
counts = np.convolve(np.ones_like(values), kernel, mode="same")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep smoothed roll tracks episode-length

When an episode has fewer than the 5-frame smoothing kernel, np.convolve(..., mode="same") returns the larger of the input and kernel lengths, so this method returns 5 samples for 1–4 frame episodes. That makes roll_L/R longer than num_frames, and pose-only twisting queries can report segments for frames that do not exist in the episode; trim the convolution result back to len(values) or handle short tracks explicitly.

Useful? React with 👍 / 👎.

everettVT added 7 commits July 7, 2026 10:10
…og-workflow

# Conflicts:
#	examples/files/hdf5_func.py
#	examples/files/hdf5_udf.py
Add editable egodex/notebook extras, rename the pipeline module so notebook kernels can import the package from datasets/egodex, and replace the broken Daft embed_image path with a SigLIP batch UDF plus Daft-native pose search helpers.
@everettVT everettVT merged commit 61d1bf5 into main Jul 7, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants