Count a repetition when a movement completes the chosen state cycle, not every time one frame satisfies an angle threshold. Separate enter and exit thresholds can keep small frame-to-frame oscillations from creating repeated counts. The signal, thresholds and lost-tracking policy must be selected and evaluated for the supported movement and camera setup.
A landmark detector, a repetition counter and a form assessment are different layers. A correct synthetic count does not validate joint measurements, exercise technique or injury prevention. Begin with the observable signal and a narrow counting definition before attaching coaching language to the result.
Choose a signal the camera can support
ML Kit documents pose landmarks and confidence information, with different operating modes and capture requirements. That provides input data for an application algorithm, not a universal rep-count function. Keep confidence and missing-landmark handling visible to the counting layer instead of treating every returned coordinate as equally usable.
Google ML Kit: pose detection input and landmark contract
An angle-based movement may use a chosen joint angle. A position-based movement may use a normalized coordinate. Define left-versus-right selection and the coordinate frame explicitly. Smoothing can reduce noise but can also delay transitions; measure that behavior rather than assuming any smoothing improves the task.
Use separate thresholds for the two transitions
The reviewed UltraFit360 pure repCounter helper starts in top, enters bottom below downThreshold and increments on returning above upThreshold at a later timestamp. Its position-based helper uses the analogous state cycle with reversed coordinate direction. The wider exercise state machine separates positioning, active and summary phases.
| Angle | State after frame | Count |
|---|---|---|
| 170° | top | 0 |
| 99°, 101°, 98°, 102° | bottom throughout oscillation | 0 |
| 159° | bottom | 0 |
| 161° | top | 1 |
| 159°, 162° | top | 1 |
The fixture transpiled and executed the pure helper with thresholds 100° and 160°. It produced one completed count. These numbers are synthetic algorithm inputs, not recommended exercise depths or validated thresholds. No camera, human recording or native pose detector was involved.
Define incomplete cycles and tracking loss
A pause in bottom should not increment the count. Repeated frames at top should not increment it either. Decide whether a long tracking gap resets to positioning, retains a partial cycle or requires a fresh confirmed top state. Otherwise a person leaving the frame and returning can finish a cycle that never occurred in the observed movement.
Include timestamps in fixtures and reject or handle out-of-order frames deliberately. The helper’s later-time check is not a complete duration filter or confidence gate. If the product needs minimum phase duration, debounce or a lost-tracking timeout, implement and test those requirements separately rather than assuming hysteresis provides them.
Count once per frame and report uncertainty honestly
The reviewed active-frame function notes that analyzing a frame twice can advance rule counters twice. Keep one analysis result per frame and share it with counting and presentation. Do not let a UI render invoke the stateful algorithm again simply to obtain a label.
Acceptance should include jitter around both thresholds, a partial descent, a long hold, missing joints, camera rotation, duplicated timestamps and two full cycles. Compare expected transitions before testing real consented recordings. When observation is insufficient, show a tracking state and retain manual correction rather than inventing completed repetitions.
The local result supports a narrow claim: this helper counted the supplied sequence once. Movement-specific accuracy requires a separate evaluation set with capture conditions and reviewed labels. Keep any displayed form score or coaching recommendation outside the evidence established by this fixture.
Keep manual correction separate from detector state. If a person adjusts the displayed count, store that correction as a deliberate user action rather than feeding the number back into an unfinished bottom phase. Decide whether correction ends the set or only changes the accepted summary. A fixture can complete one cycle, apply a correction and then continue another cycle. The expected result should preserve both observed transitions and the user’s accepted record without inventing extra camera evidence.
Ai exercise form tracking limitations
Explore UltraFit360 on the App Store
Explore UltraFit360 on Google Play
Bring one client-to-coach workflow, current data contract and acceptance constraint to discuss a bounded fitness product build or integration pilot.
Explore health fitness app development
How can a pose-based rep counter avoid counting threshold jitter as repetitions?
Use a movement-specific signal with separate enter and exit thresholds, count completed state transitions and define what happens when tracking is lost.
Does hysteresis alone validate exercise form?
No. It controls state transitions. Landmark accuracy, movement interpretation and coaching claims need separate evaluation.
