وثبة means leap. Wathba helps patients in Qatar practise their therapist-assigned exercises at home, and shows their physiotherapist that work between appointments.
Problem
Physiotherapy happens at home. No therapist sees it.
Ahmed Matarid and his team with the trophy.
Ahmed’s story
Ahmed Matarid, one of our team members, had already won the Qatar high school football league when he tore his ACL just before going into a championship.
He did five months of physiotherapy with Hamad, in the public sector, which is the maximum Hamad allows. After that, he had to continue online, with physiotherapy over WhatsApp. It was very inconsistent, and after four months Ahmed stopped because he was no longer motivated to continue.
Clinic appointments are only part of recovery. Most of the work is done at home, one repetition at a time, with nobody watching. Between visits there is no one to tell you whether a movement is right, or to notice when it starts to go wrong.
Physiotherapy in Qatar
Demand keeps growing. Capacity has not caught up.
Three sources, from 2017 to this summer, tell the same story.
2017Qatar University MBA project
Physiotherapists are stretched, and many leave
58%strongly agreed their number of patients is increasing
77%worked 40 hours a week or more
20 of 25who resigned from HMC left for better pay
Low pay and unfavourable contracts were the biggest problem, and rising demand came second. Extra hours without extra pay hurt motivation and retention, and hospital managers tied staff shortages to budget limits and to Qatar paying less than Saudi Arabia and the UAE.
Hamad Medical Corporation opened a new physiotherapy outpatient department for men at Aisha Bint Hamad Al Attiyah Hospital. It described the move as a response to growing demand, and said the expansion would reduce waiting times.
Average of these three rates, using the midpoint of each package range. Wellkins prices are for 5-session packages. This is a small sample of published prices, checked in November 2026, before any insurance cover. Actual prices vary by clinic and condition.
Our solution
Your therapist’s eye at home.
Wathba | وثبة is our physiotherapy prototype for the Qai × Hugging Face hackathon. It helps patients practise therapist-assigned exercises at home and gives their physiotherapist visibility between appointments. It is built for physiotherapy in general, not one injury: the therapist records a reference for an exercise, and the patient’s movement is measured against it. Our demo uses ACL rehab, with squats and jumps, because that is Ahmed’s story. Other exercises can be added the same way.
TrainSeeReview
What we’ve built
Therapist reference
A separate demonstration video provides the movement reference.
Patient recording
Patients can use their camera or upload a video.
Movement analysis
We count repetitions and compare movement patterns, excursion, tempo, consistency, and visible alignment differences.
Live coaching
Large, colour-coded comments, also spoken aloud: rep counts, “good form” or one short correction.
Feedback and review
Sessions include skeleton replay, flagged moments, measurements, and evidence clips. Newer reports also show paired patient and reference pictures.
Therapist workspace
Session history, reports, saved feedback, and repetition-target settings.
Why it helps
More available therapists
Reports show what happened between appointments, which reduces the time spent with each patient and leaves therapists more available.
Motivation to keep going
Tracking reps and progress gives patients something to work towards. Losing motivation is what ended Ahmed’s online physiotherapy.
Rehab that fits your day
Patients can practise at home, on their own schedule, without travelling for every exercise session.
Problems caught sooner
Flagged moments show therapists where a movement went wrong, without waiting for the next appointment to find out.
Feedback in Arabic
Session feedback is available in Arabic and English.
Fewer extra costs
Support between visits may reduce the need for extra private sessions, at around QAR 300 each.
Not a diagnosis. The therapist decides.
Models
What’s under the hood
Measure first. Then explain. We started with MediaPipe, which performed better at detection, but we chose to challenge ourselves and build on the models below instead.
Pose models measure the movement, and Qwen explains the measured results. All of them are available on Hugging Face.
Writes session summaries and answers questions using measured results.
On Hugging Face
How it all connects
Training, models, storage and the app all run on Hugging Face. Only live pose tracking runs on the patient’s phone, so the camera video stays there during the set.
Dataset. We trained on real exercise photos from MPII Human Pose on the Hub.
Train. Hugging Face Jobs fine-tuned YOLOv8n-pose on an A10G GPU in two rounds, then tested it on CPU. The jobs-artifacts storage bucket keeps the scripts and logs.
App. The Wathba app Space serves the pose models at pinned versions, counts reps and scores each set. Qwen3-4B writes summaries and answers through Hugging Face Inference Providers, using only the session’s numbers and the patient’s typed answers. The Space’s own T4 GPU is the backup.
Live. The phone runs YOLOv8n-pose and MoveNet for live tracking, comments and voice. After each set it sends the tracked joints and video to the Space, which counts reps, scores the set and writes the summary.
How it runs
Each arrow is a real request. Solid arrows carry data the way they point, two-headed arrows fetch something, and dashed arrows are replies.
Phone ↔ SpaceGET /api/configModels and settings.
Phone ← SpaceGET /vendor/models/…Pose model files. The phone then tracks every frame itself.
Phone → SpacePOST /api/uploadThe recording, after the set.
Phone → SpacePOST /api/processThe tracked joints. The Space counts reps and scores the set.
Phone → SpacePOST /api/workout/check-inPain and effort answers.
Phone → SpacePOST …/ai/summary, /ai/askOnly with the patient’s consent. The Space sends back a checked reply.
Space → Inference ProvidersPOST /v1/chat/completionsQwen3-4B gets numbers and typed answers only. The Space’s own T4 GPU is the backup.
Hub → Spacehf_hub_downloadModel files at fixed revisions, SHA256 checked, at build.
Jobs → Hub and bucketupload_folderTraining pushes the fine-tuned model to the Hub, and scripts and logs to the jobs-artifacts bucket.
Everything we used on Hugging Face
Spaces
The Wathba app Space on a T4 GPU runs the app and the reports, and can run Qwen3-4B itself as a backup. This blog is a separate static Space.
Jobs
Fine-tuning YOLOv8n-pose on an A10G GPU, in two rounds.
Storage bucket
A private bucket, jobs-artifacts, keeps every job’s scripts and logs.
Qwen3-4B through Hugging Face Inference Providers, with the app Space’s own GPU as backup. The pose models run on every video frame, so they stay in the browser rather than calling a server.
This blog is a separate static Space.
Data privacy
What leaves the phone, and where it goes
On the phone first
Body tracking runs first, in the patient’s own browser: the fine-tuned YOLOv8n-pose and MoveNet run on the phone with ONNX Runtime Web. Live camera frames never leave the device while the patient exercises, which is better for patient privacy.
After each set
The recording and the tracked joints are uploaded only to the Wathba Space, our own server, which counts the reps, scores the set and builds the report.
Summaries and answers
Qwen3-4B writes them through Hugging Face Inference Providers, using only the session’s numbers and the patient’s typed answers. Video and pictures are never sent, and the provider’s data policy applies to that text.
Consent
The patient must tick a consent box before any summary or answer is written.
Our own server
For stronger privacy, the same model can run on our own servers instead. The app already supports this, and the Space GPU is the backup.
Safety checks
Every reply is checked by the app’s rules and retried up to 3 times. If it still fails, the patient sees a fixed summary written by the app instead.
Wathba is a hackathon prototype. It is not a medical device and has not been clinically validated.
Fine-tuning
Teaching the model our use case
We fine-tuned YOLOv8n-pose on Hugging Face Jobs and tested it before and after on data it never trained on. The pass rule was written down before training started, and we keep the model only if it wins.
For YOLOv8n-pose. Real photos with labelled joints. We used its exercise images: 1,264 to train, 150 to validate and 328 to test. Round 2 also tried adding 3,540 of its sports photos. Research use only, no commercial use.
YOLOv8n-pose: passed
+4.9 ptship, knee and ankle accuracy, 51.1% to 55.9%
+2.5 ptspeople found, 88.3% to 90.8%
+5.3 ptsjoints the app can use, 50.0% to 55.3%
We fine-tuned on 1,264 real exercise photos from MPII. We set the pass rule before training: leg joint accuracy had to rise with a 95% interval above zero, without losing people, usable joints or speed. The gain was 4.9 points, with an interval of 2.1 to 7.7. Speed stayed the same, and the smaller version used for detection in the browser found 90.4% of people, up from 85.6%.
The test used 328 photos of 436 people from activity types the model never trained on: resistance training, calisthenics and mild stretching. A joint counts as correct if it lands within half a head length of the true position. These are general exercise photos, not physiotherapy patients, so we also tested it on our own squat clips. It tracked every frame and found all 20 repetitions, with an 82% reference match against 83% for the original model. It was stricter, though: 12 repetitions matched the reference instead of 18, and it flagged 6 moments instead of 2. This is the model the demo uses. YOLOv8n-pose finds the person and backs up MoveNet, so this improves those steps, not the main live tracking.
Accuracy by body part, with 95% intervals. Left and right sides are combined.Hip, knee and ankle accuracy at each allowed error.Each dot is one or more test photos.
Not every photo got better.
133 photos improved, 116 stayed the same and 79 got worse. The gain holds across the whole test set, but it is not uniform.
Predicted against true hip-to-ankle distance
This is the distance our squat measurement depends on. Each dot is one of the 301 people both models found, and the closer the dots sit to the dashed diagonal, the better. The solid line is the fitted regression. A negative distance means the ankles are above the hips, as in some floor exercises. Average error improved from 0.44 to 0.42 head lengths, but R² fell from 0.793 to 0.755, so the fit along the line got slightly worse. The fine-tuned model is closer for 166 of the 301 people, but it has more very large misses (7 against 4 above three head lengths), which R² punishes heavily.
Training
Show the numbers
Body part
Current
95% interval
Fine-tuned
95% interval
Hips
60.4%
55.5 to 65.5
65.6%
60.4 to 70.5
Knees
48.0%
42.9 to 52.9
51.7%
46.8 to 56.7
Ankles
43.4%
38.3 to 48.3
49.2%
44.0 to 54.0
Shoulders
72.6%
68.0 to 77.3
77.2%
72.6 to 81.9
Elbows
63.1%
58.7 to 67.9
67.2%
62.6 to 71.9
Wrists
62.5%
58.2 to 66.7
65.0%
60.7 to 69.8
Round 2: passed the test, not used in the demo
60.3%hip, knee and ankle accuracy, up from 55.9% in round 1 and 51.1% originally
+4.4 ptsgain over round 1, 95% interval 2.1 to 6.6
-0.5 ptspeople found against round 1, 90.8% to 90.4%
Round 1 passed, so we decided to fine-tune further. We unfroze the whole model and trained for 100 epochs at a lower learning rate. We compared two runs: one on the same 1,264 exercise photos, and one that added 3,540 sports photos from MPII.
Adding sports photos did not help. On the 150 validation photos, the exercise-only run scored 60.0% and the run with sports scored 57.1%, so the exercise-only run went forward. The original model scored 47.4% on those photos. Neither run saw the locked test photos, and the winner was tested on them once.
Round 2 beats round 1 on these photos. The rule was written down before training: it had to beat round 1 with a 95% interval above zero, without losing more than 1 point of people found, without losing usable joints, and within 10% of the speed. The closest call was people found, which fell 0.5 points. Speed was 3% slower, and the smaller browser version found 89.7% of people against 90.4% in round 1.
The test used the same 328 photos of 436 people as round 1. These are general exercise photos, not physiotherapy patients. On our own squat clips it did worse, so we did not use it. It tracked 66 of 84 frames of the therapist video, against 84 of 84 for round 1, and found 16 of the 20 patient repetitions. A model has to work on real rehab footage, not only score well on a test, so the demo keeps round 1.
Accuracy by body part, with 95% intervals. Left and right sides are combined.Hip, knee and ankle accuracy at each allowed error, for all three models.Each dot is one or more test photos, compared with round 1.
Not every photo got better.
Against round 1, 118 photos improved, 148 stayed the same and 62 got worse.
Predicted against true hip-to-ankle distance
This is the distance our squat measurement depends on. Each dot is one of the 297 people all three models found. Round 2 fixes the weakness we saw in round 1. R² rose to 0.883, the best of the three models (original 0.848, round 1 0.822), average error fell to 0.34 head lengths, and misses above three head lengths went from 6 to 3. Round 2 is closer for 167 of those people.