Counting looks simple to a human and is surprisingly hard for a computer. FitForm uses a pose model from an open library to locate thirty-three key points on the body: shoulders, elbows, wrists, hips, knees and ankles among them. The model returns these points for every frame, about thirty times a second, and all of this work happens on the student's own device.
From the points, the program computes joint angles. For a squat, the important angle is at the knee, formed by the hip, the knee and the ankle. The program then uses a small state machine with two states. The student starts in the standing state, where the knee angle is above one hundred and sixty degrees. When the angle falls below one hundred degrees, the state changes to down. Only when the student returns to standing does the counter add one repetition.
This design prevents a common trick. If the counter simply added a point whenever the angle changed, a student could shake slightly and collect points without real effort. Because a repetition is only complete when both states have been visited in order, partial movements earn nothing. The same idea, with different joints and thresholds, supports all six exercises in the app.
Vocabulary in this text
- model /ˈmɑdəl/ — a program trained on data to make predictions
- compute /kəmˈpjut/ — computing power used to run programs
- joint /ˈdʒɔɪnt/ — a place where two bones meet
- repetition /ɹˌɛpəˈtɪʃən/ — one complete performance of an exercise
- prevent /pɹɪˈvɛnt/ — to stop something from happening
- effort /ˈɛfɚt/ — the energy you use to do something
- earn /ˈɝn/ — to get money by working, or to deserve something
- threshold /θɹˈɛˌʃoʊld/ — the level at which something starts to happen
- support /səˈpɔɹt/ — to help someone or agree with them