fix(lerobot): stop flooring a fractional source fps - #461
Merged
kstonekuan merged 3 commits intoSep 7, 2026
Conversation
kstonekuan
approved these changes
Sep 7, 2026
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.
Fixes #458
meta/info.jsonis allowed a fractional fps and_parse_dataset_informationstores it asone, but the single call site floored it with
int(source_archive.fps). A corpusdeclaring 29.97 was converted as if it were 29.
The keyframe interval is the primary half.
_transcode_mp4_to_h264computesround(gop_seconds * frames_per_second), which is 30 at the declared rate and 29 at thefloored one, so the file carried a 29 frame GOP while
provenance/v1stampedgop_secondsas1. That field is recorded as what was actually used and nothing checksit, which is what #376 is open about. This was one of the ways it could already be false.
The time axis is the visible half. Log times are
frame_index * 1e9 / frames_per_second,so the whole episode stretches:
Both consumers already took a float, so the fix is the
int()at the call site and theannotation that forced it.
CONVERTER_VERSIONmoves to v8, and the reason is resume rather than bytes._episode_identity_matchescompares dataset, revision, episode index, camera keys,converter version and gop_seconds. It never looks at fps, so an episode delivered before
this fix with the stretched time axis still matches on every field and the resume path
would hand it back as completed work. The bump is what makes those episodes fail identity
and be re-converted. This differs from the bumps in #390 and #403: those moved every
episode's content id, this one changes bytes only for fractional-fps sources, and an
integer-fps corpus produces identical output either way.
Tests, in the order they were asked for:
All four fail on the commit before the fix. The corpus helper now takes an fps so the
end-to-end import runs at 29.97 rather than the integer 30 every existing fixture uses,
which is why this survived: nine fixtures, all at 30, and
int(30.0)is 30.tests/test_lerobot_converter.py tests/test_lerobot_metadata_refusals.py tests/test_lerobot_export.py: 107 passed.ruff check,ruff format --checkandty checkare clean.