Skip to content

About

RepCounter AI: free rep counter that runs in your browser. Record or upload a set; video never leaves your device.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

RepCounter

Try it: https://repcounterai.com/

Upload a video of a set, and RepCounter counts your reps in the browser. For curls it tracks each arm separately and flags uneven sets. You can confirm or correct the count, log the weight, and get a next-session target.

Everything runs on your device. Videos are never uploaded or stored; only the set summary (date, exercise, weight, reps, effort) is saved to localStorage.

How it all works (stack, pipeline, lessons learned, tuning): docs/GUIDE.md

No video handy? Try a sample set loads a free side-view squat clip (Pexels 9001924, 3 squats) and counts it. After saving, Share makes a story-sized image of the set (the phone's share sheet, or a download on desktop). The site can be added to the home screen. Inside TikTok, Instagram, Facebook, LinkedIn or Snapchat's built-in browser, a notice suggests opening the page in Safari or Chrome, since those often block the camera and uploads.

Recording in the browser

Tap Record a set to film with the phone or laptop camera instead of uploading. It records video only, without the microphone, so music playing in another app isn't interrupted. There is a 0/3/5/10 s start timer, a front/back camera switch, and the screen is kept awake while recording. The recording is counted exactly like an uploaded clip and is never stored. The camera needs a secure page: localhost, or the site served over https.

How it works

  1. The clip is sampled at 15 fps and each frame goes through the MediaPipe Pose Landmarker (lite model, WebGL with a CPU fallback).
  2. A joint angle is median-smoothed and fed to a state machine with hysteresis: a rep counts only after a full extension, a full bend, and a return to extension. Low-confidence frames pause counting rather than guessing.
    • Curl: elbow (shoulder–elbow–wrist), bent ≤ 70°, straight ≥ 150°.
    • Squat: hip drop. The hip-to-ankle height (vertical position only) is compared with your standing height, so standing reads the same whatever the camera height, distance or angle. The standing height is kept for the whole video, so holding the bottom of a squat never turns into "standing". Hip drop is shown as a percentage: how much the on-screen hip-to-ankle height shrank. It is a video measurement, not a joint angle. A rep counts at a 15% hip drop once you stand back up; reps that never reach 35% still count but are marked "go deeper". Both legs are averaged when both are clearly visible; otherwise the more visible leg is used. Stepping back from the phone after starting a recording does not count as a rep: once you stand still at the new distance, that becomes the new standing height.
    • Lateral raise: shoulder angle (hip–shoulder–elbow), one arm at a time or both. A rep is arm down (≤ 35°), raised (≥ 60°), and back down.
    • Shoulder press: elbow angle with both arms. A rep is dumbbells at the shoulders (≤ 100°), pressed overhead (≥ 145°), and back down.
    • Pull-up: elbow angle with both arms, straight (≥ 140°), bent (≤ 90°), and back to straight.
  3. Each rep gets a timestamp you can click to jump to it in the video.
  4. Sets of an exercise saved on the same day are one workout. The next workout's target uses that workout's sets at its heaviest weight (so warm-ups don't count). Reps first, then weight: the target is one more rep than your best set; once your best set reaches the top of the rep range, the weight goes up and the target restarts at the bottom. A set marked Failed blocks the weight increase, and if even your best set was 3+ reps short of the range, the target drops one weight step. The rep range (default 5–8; presets 3–5, 5–8, 5–12, 12–20, or custom) and weight step are editable per exercise.
  5. Any exercise can be logged by hand ("No video? Enter reps by hand"), and + Add exercise adds your own (name plus total, per-dumbbell or bodyweight). Added exercises are logged by hand only.

Supported

  • Exercises: dumbbell curl and lateral raise (one arm, or both arms together or alternating), squat (bodyweight or loaded), shoulder press, pull-up. Raise and pull-up thresholds were tuned on RepCount-A clips (see Dataset eval). Bench press was tried and left out: it counted well from the side but badly in crowded or head-on clips.
  • Video: anything the browser can decode. iPhone .mov (HEVC) works in Chrome and Safari on macOS; Firefox can't decode HEVC.
  • Filming: phone held still. Curls need the shoulder and torso in frame, and front-facing is best for both-arm sets. Squats need hips, knees and ankles in frame; side, three-quarter and front views all work. Lateral raises: film from the front. Pull-ups: from the front or behind, with the bar in frame. Shoulder press: from the front, with room above your head.

Run it

npm install
npm run dev     # http://localhost:5173
npm test        # unit tests, including recorded pose data from real clips
npm run build

Requires Node 22.12+ (or 20.19+). Pushing to main runs the tests and deploys to GitHub Pages (.github/workflows/deploy.yml).

Testing

See .kiro/specs/rep-analyzer/manual-test-notes.md for what has been verified on real video and what is still an assumption.

Dataset eval

npm run eval checks counting against labelled clips from RepCount-A (real videos with hand-counted reps). It runs the app's own pose pass on each clip in headless Chrome, caches the landmarks, counts with the app's scoring code, and prints true vs counted reps per clip.

scripts/eval/fetch-repcount.sh       # test split, 1.5 GB (RC_SPLITS="test validation" for more)
python3 -m venv test-videos/.venv && test-videos/.venv/bin/pip install pylance
test-videos/.venv/bin/python scripts/eval/extract-repcount.py test validation
npm run eval                         # first run extracts poses (about 1 min per clip per worker)
npm run eval -- --rescore            # re-count from cached poses in seconds

Shoulder press and lateral raise are also checked on seated dumbbell sets from MM-Fit (Strömbäck, Huang and Radu, IMWUT 2020; videos on Zenodo, CC BY 4.0): python3 scripts/eval/mmfit-labels.py, then python3 scripts/eval/mmfit-clips.py, then npm run eval -- --dataset mmfit. Only the labelled sets are cut from the videos, about 25 MB.

RepCount-A is for research use only. The videos, poses and results stay in the gitignored test-videos/datasets/ and are never committed. Needs Chrome at the macOS default path (or set CHROME) and ffprobe.

About

RepCounter AI: free rep counter that runs in your browser. Record or upload a set; video never leaves your device.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages