Skip to content

feat: live pose overlay for form checking (issue #17 MVP) - #23

Open
mohansree14 wants to merge 1 commit into
arvids-unavailable:mainfrom
mohansree14:feat/form-check-pose-overlay
Open

feat: live pose overlay for form checking (issue #17 MVP)#23
mohansree14 wants to merge 1 commit into
arvids-unavailable:mainfrom
mohansree14:feat/form-check-pose-overlay

Conversation

@mohansree14

Copy link
Copy Markdown

Summary

Adds a Form check button to each exercise during a workout that opens the front camera and overlays a live pose skeleton on top of it, using on-device MoveNet (tfjs) pose detection — no video frame ever leaves the browser.

This is scoped as the MVP discussed in #17: prove the pose-detection pipeline works end-to-end in the app, without rep-counting or form-correction logic yet. Happy to build on this (angle-based rep counting, per-exercise cues, etc.) as a follow-up once the approach itself looks right.

Closes #17 (as an MVP — see note above).

What's included

  • frontend/src/components/FormTracker.jsx — camera + canvas skeleton overlay
  • @tensorflow/tfjs + @tensorflow-models/pose-detection (MoveNet Lightning — small, fast, good enough for a single lifter in frame)
  • Code-split via React.lazy/Suspense so the model/runtime (~1MB+) only loads when the sheet is opened, not on every app boot — kept the main bundle size where it was
  • @mediapipe/pose aliased to a tiny local stub in vite.config.js: pose-detection statically imports it for the BlazePose "mediapipe" runtime, which this MVP doesn't use, and the real package isn't ESM/bundler-friendly (breaks the Vite build otherwise)
  • A new camera icon in the existing hand-drawn icon set

Known limitations (by design, for an MVP)

  • No rep counting or form-correction feedback — just the live skeleton overlay
  • MoveNet model weights load from Google's hosted CDN (tfhub.dev) at runtime by default, same as any other tfjs-models usage — not bundled/self-hosted. Worth revisiting if that matters for the project's self-hosted/no-third-party-calls ethos; flagging rather than solving it here to keep this PR scoped.
  • Single person in frame (MoveNet SINGLEPOSE)

Test plan

  • npm run build succeeds
  • npm test — all 192 existing tests pass unchanged
  • Verified dev server serves the app without runtime errors
  • Manual camera QA on a real device — I didn't have browser/webcam access in the environment I built this in, so the camera permission / live overlay path itself is untested beyond code review. Would appreciate a real test pass before merge.

…MVP)

Adds a "Form check" button to each exercise during a workout that opens
the front camera and overlays a live MoveNet skeleton on top of it, using
on-device tfjs pose detection (no frames leave the browser). Scoped as an
MVP per the issue discussion: proves the pose-detection pipeline works
end-to-end in the app before any rep-counting or form-correction logic is
built on top of it.

- FormTracker.jsx: camera + canvas overlay component
- @tensorflow/tfjs + @tensorflow-models/pose-detection (MoveNet Lightning)
- code-split via React.lazy so the ~1MB+ model/runtime only loads when the
  sheet is opened, not on every app boot
- @mediapipe/pose aliased to a stub in vite.config.js — pose-detection
  statically imports it for the BlazePose runtime we don't use, and the
  real package isn't ESM-bundler-friendly
@mohansree14
mohansree14 force-pushed the feat/form-check-pose-overlay branch from e3b4ead to eb38d17 Compare August 24, 2026 23:46
@mangeshraut712

Copy link
Copy Markdown

Not landing in #28. CONTRIBUTING is explicit about staying dependency-light, and MoveNet weights load from Google's CDN — that fights the self-hosted / no-third-party-calls model. The overlay is a reasonable MVP for #17 once weights are vendored or optional. Please keep as a follow-up, not in the hygiene PR.

@SunriseDuarte

Copy link
Copy Markdown

Heads up: openGym has moved to GitLab.
-> GitLab

The GitHub repo is no longer maintained (the account was suspended, so it's out of my hands). Please re-open this issue/PR on GitLab so it doesn't get lost, I'll pick it up there. Questions, help and roadmap discussion now happen in Discord:
-> Discord

Sorry for the noise, and thanks for sticking around.
more infos here: openGym

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.

Form Tracking - Feature Request

3 participants