We use Optical flow to count reps.
Optical flow is the pattern of apparent motion of image objects between two consecutive frames in a sequence (e.g. frames in a video).
It shows the movement of points fetween frames using a 2D vector field, where each vector represents the displacement (difference) of frames.
We use Open CV's implementation of Dense Optical Flow using Gunner Farneback’s algorithm to track the movement of the user performing the exercise.
The algorithm calculates the optical flow for every pixel in the image.
Because anarobic exercises are Home consistent and repetitive motion, we can track the change in direction of movement as an example of a repetition
And because optical flow tracks movement - we can use the same algorithm for all exercises, negating the need to train multiple models.