Count reps from
pose keypoints

Zero-dependency JS library that counts exercise reps from pose detection keypoints. Works with MediaPipe, MoveNet, PoseNet — geometry-based rep counting, no neural networks.

// Import — no instantiation needed import { countReps, getCount } from 'rep-counter'; // Call with each frame const result = countReps(keypoints, 'push-ups'); // → { repCount: 5, state: 'UP', feedback: 'Rep 5!' }
9+ exercises + variations
0 dependencies
~1kb minzipped

Built for developers

No ML models, no heavy dependencies. Just pure angle math that works with any pose detection output.

Zero dependencies

Just the math. No PyTorch, no TensorFlow — doesn't run any ML itself.

Framework agnostic

Node.js, browser, React Native, Expo. The function doesn't care about your stack.

Debounced

300ms minimum between reps prevents false positives from pose jitter.

TypeScript

Full type definitions included. Works with inference, auto-complete, and type safety.

State machine

Each exercise has a defined state machine. Rep counts on DOWN → UP transition.

Extensible

Add custom exercises with just angle thresholds. No ML training needed.

Pipeline

Camera
MediaPipe
Keypoints
rep-counter
Rep: 5

Try it

Paste pose keypoints (from MediaPipe/MoveNet) to test rep counting.

Quick test:

0
rep count
WAITING
state
feedback

9 exercises + variations

Push-ups Squats Pull-ups Dips Burpees Sit-ups Lunges Mountain Climbers Jumping Jacks

+ incline push-ups, decline push-ups, jump squats, chin-ups, and more