Conversation
The torchvision_av branch of get_frames_by_timestamps seeked to the nearest preceding keyframe and returned every frame it decoded up to the last requested timestamp, while the decord and opencv branches return one frame per requested timestamp as documented. vla_dataset turns each returned frame into its own ViT image, so the number of image tokens packed per sample varied with distance from a keyframe. Apply the per-timestamp matching and length validation already present in the Being-H-EDU copy of this function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for releasing this — a note on one difference between the video backends.
Summary
get_frames_by_timestampsdocuments its return as "Frames as numpy array of shape (N, H, W, C)"for N requested timestamps. The
decordandopencvbackends return exactly that; thetorchvision_avbackend seeks to the nearest preceding keyframe and returns every frame itdecodes up to the last requested timestamp.
configs/posttrain/libero/libero_all.yamlandconfigs/posttrain/so101/so101_example.yamlbothset
video_backend: "torchvision_av", so this is the default path for the shipped configs.tutorials/Being-H-EDU/BeingH/utils/video_utils.py, which already carries per-timestamp matchingand a length check.
Root Cause
The extra frames reach the model because
BeingH/dataset/datasets/vla_dataset.pyturns each returnedframe into its own ViT image:
With the default
obs_indices=[0], the dataset asks for exactly one frame per view per sample, butthe number it gets back — and therefore the number of image tokens packed into the sequence —
depends on how far the sample is from a keyframe.
Measured on two LeRobot datasets, requesting a single timestamp at frame 0, 5, 20, 50 and 100:
Being-H-EDU_SO101/pick_cube_plate_trimmed(h264)IPEC-COMMUNITY/libero_spatial_no_noops_1.0.0_lerobot(av1)The size of the effect tracks keyframe spacing in each encode, so it is pronounced on the SO101
videos and mostly invisible on these LIBERO ones.
Test plan
libero_spatial(Being-H05-2B+InternVL3_5-2B+Qwen3-0.6B, 1×H100) before and after the change: both complete, checkpoint andlibero_posttrain_metadata.jsonwritten as expected. This is a no-regression check — theframe-count table above is what demonstrates the fix.