Skip to content

Apply activity-specific cutoff frequency to 2D keypoint filtering - #10

Open
Seeeeeyo wants to merge 1 commit into
mainfrom
fix/activity-specific-keypoint-filter-cutoff
Open

Apply activity-specific cutoff frequency to 2D keypoint filtering#10
Seeeeeyo wants to merge 1 commit into
mainfrom
fix/activity-specific-keypoint-filter-cutoff

Conversation

@Seeeeeyo

@Seeeeeyo Seeeeeyo commented Aug 2, 2026

Copy link
Copy Markdown

Summary

  • The Butterworth low-pass filter applied to the 2D keypoints used in the reprojection loss (optimization.py) was previously always run with the function's default 6 Hz cutoff, because it ran before the activity (walking/treadmill/squat/STS/other) was classified.
  • The activity-specific cutoff frequencies defined in params/parameters.yaml (6 Hz walking/treadmill, 4 Hz squat/STS, 8 Hz other) were computed but only ever fed into an FFT-based smoothness loss term (loss_frequency) whose weight is absent from every weight preset, so they had no effect on the actual keypoint filtering (or on anything else, since that loss term is effectively dead given its zero/missing weight).
  • This PR defers the keypoint filtering step until after activity detection, so the intended per-activity cutoff frequency is applied to the 2D keypoints that feed the reprojection term of both optimization stages, matching the documented/intended behavior.

Test plan

  • Verified optimization.py parses correctly (ast.parse) with the project's opencap conda environment.
  • Run run_optimization end-to-end on a walking, squat/STS, and "other" sample video to confirm activity-specific filtering is applied and results remain reasonable.

Made with Cursor

Previously, the 2D keypoints used in the reprojection loss were
Butterworth-filtered with the default 6 Hz cutoff before the
activity (walking/squat/STS/other) was classified, so the
activity-specific cutoff frequencies in params/parameters.yaml never
actually reached the keypoint filter. Defer the filtering step until
after activity detection so the intended per-activity cutoff is used.

Co-authored-by: Cursor <cursoragent@cursor.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.

1 participant