Skip to content

Comments

Fix FPS truncated to integer in multiple locations#203

Open
AmitMY wants to merge 1 commit intomasterfrom
fix/fps-float-precision
Open

Fix FPS truncated to integer in multiple locations#203
AmitMY wants to merge 1 commit intomasterfrom
fix/fps-float-precision

Conversation

@AmitMY
Copy link
Collaborator

@AmitMY AmitMY commented Feb 21, 2026

Summary

Fixes #201PoseBody.fps is typed as float (since v0.2), but several locations cast it to int, silently losing precision for non-integer framerates like 29.97 fps (NTSC standard).

Changes:

  • utils/openpose.py: Remove int(fps) cast in load_openpose() — pass fps through as-is
  • utils/generic.py: Fix fake_pose() signature from fps: int=25 to fps: float=25.0, remove int(fps) cast
  • tensorflow/pose_body.py: Change TFRecord field from tf.int64 to tf.float32, serialize as FloatList instead of Int64List, remove unnecessary tf.cast on deserialization
  • utils/holistic.py: Fix load_mediapipe_directory() type annotation from fps: int to fps: float
  • numpy/pose_body.py: Fix interpolate() type annotation from new_fps: int to new_fps: float

Test plan

  • Existing tests pass (72/72, excluding pre-existing TF import failures)
  • Verified fake_pose(10, fps=29.97) now preserves 29.97 instead of truncating to 29

Note

Breaking change for TFRecord: Existing TFRecords serialized with int64 fps will not be compatible with the updated float32 schema. This is intentional — the old format was lossy.

🤖 Generated with Claude Code

Remove int() casts and fix type annotations that truncated non-integer
framerates (e.g. 29.97, 23.976 fps) to integers, causing audio/video
sync drift.

Fixes #201

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

FPS truncated to integer in multiple locations, losing precision for non-integer framerates

1 participant