Wathba logo

Wathba·وثبة

Physio rehab your therapist can see.

Qai × Hugging Face Hackathon, Doha, November 2026

Wathba app during a physiotherapy squat, showing the patient's live camera view with skeleton tracking, a movement prompt and a rep counter

وثبة 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 teammates in red and black kits, wearing medals and holding a gold trophy on a football pitch at night
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.

  1. 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.

    Refaa Alenazi, Physiotherapists’ Challenges in Qatar and Their Effect on Performance and Retention, Qatar University, 2017.

  2. 202428 July 2024

    HMC expands to meet demand in the north

    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.

    Qatar Tribune, 28 July 2024.

  3. 202621 July 2026

    Saturday clinics are overbooked

    104%of available Saturday capacity was booked last year
    4,893appointments booked
    4,704slots available

    Primary Health Care Corporation now offers physiotherapy at 15 health centres, with around 69 physiotherapists.

    The Peninsula, 21 July 2026.

Going private is a recurring bill

QAR 300

a session, on average

Rehab is not one visit. At two sessions a week, that is about QAR 2,600 a month, for as long as recovery takes.

Published private rates, DohaPer session
Wellkins Medical Centre, regular packagesQAR 100–140
Wellkins Medical Centre, advanced packagesQAR 160–200
MVP Physiotherapy Center, 45 minutesQAR 600

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.

Live exercise screen with skeleton tracking, a prompt to check knee and trunk position, and a rep counter
Train
Exercise complete screen showing a 78 percent reference match with movement, tracking and control results
See
Therapist portal showing a patient's latest session, flagged moment and progress chart
Review

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.

YOLOv8n-pose

Our fine-tuned model. Finds and selects the person, rechecks their location about every second, and supplies joint tracking if MoveNet fails.

MoveNet SinglePose Lightning

Tracks 17 body keypoints continuously for live movement analysis. Runs in the browser.

Qwen3-4B

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.

Everything Wathba has on Hugging Face and how it connectsEverything Wathba has on Hugging Face. MPII Human Pose on the Hub feeds Hugging Face Jobs, which keep scripts and logs in the jobs-artifacts bucket and push our fine-tuned YOLOv8n-pose to the Hub. The Wathba app Space downloads our YOLOv8n-pose, MoveNet and Qwen3-4B at pinned versions, asks Qwen3-4B on Inference Providers for summaries with only numbers and text, and serves the app to the patient’s phone, which tracks every frame and sends results back. The blog is a second, static Space.1HUB · DATASETS2JOBS · STORAGE3HUB · MODELS4SPACES · RUNTIMEMPII Human Posepublic · exercise photosphotosHugging Face JobsA10G GPUFine-tunes YOLOv8n-posein 2 roundsjobs-artifacts bucketprivate storagescripts + logsmodelWathba YOLOv8n-poseours · fine-tunedMoveNetXenova · pose trackingQwen3-4B-Instruct-2507Qwen · summariesAll three are downloadedinto the app at fixed versions.Wathba app SpaceGradio SDK · T4 GPUCounts reps, scores,writes reports, checksevery Qwen reply.Inference Providersruns Qwen3-4Bnumbers + text↑ summaryPatient's phonebrowserYOLO + MoveNet track everyframe. Video stays here.app ↓results after each set ↑wathba-blog Spacestatic · links to the appON HUGGING FACESpaces: 2 (app + blog)Models: 1 ours, 2 othersDatasets: 1Storage buckets: 1Everything Wathba has on Hugging Face. MPII Human Pose on the Hub feeds Hugging Face Jobs, which keep scripts and logs in the jobs-artifacts bucket and push our fine-tuned YOLOv8n-pose to the Hub. The Wathba app Space downloads our YOLOv8n-pose, MoveNet and Qwen3-4B at pinned versions, asks Qwen3-4B on Inference Providers for summaries with only numbers and text, and serves the app to the patient’s phone, which tracks every frame and sends results back. The blog is a second, static Space.1DATASETHugging Face HubMPII Human PoseReal exercise photoswith labelled jointsphotos2TRAINHugging Face JobsFine-tune YOLOA10G GPU, 2 roundsfine-tuned model3MODELSHugging Face HubFine-tuned YOLOMoveNetQwen3-4Bpinned models4APPHugging Face SpaceWathba appCounts reps, scoresAsks Qwen3-4B forsummariesapp + pose models5LIVEPatient's phoneTracks on the phoneYOLO + MoveNetfrom the HubVideo stays on phoneresults after each setInferenceQwen3-4B through Hugging FaceInference Providers. Only numbersand typed answers are sent. Our ownSpace GPU is the backup.StorageThe jobs-artifacts bucket keepsevery job’s scripts and logs.
  1. Dataset. We trained on real exercise photos from MPII Human Pose on the Hub.
  2. 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.
  3. Models. The fine-tuned model went back to the Hub as team-qh-005-wathba-yolov8n-pose, next to MoveNet and Qwen3-4B.
  4. 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.
  5. 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.

How it runsThe phone gets its settings and the pose model files from the app Space, then tracks every frame itself. After the set it uploads the recording, the tracked joints and the check-in answers. With consent, the Space asks Qwen3-4B on Hugging Face Inference Providers for a summary, sending only numbers and typed answers, and returns a checked reply. The Space gets its model files from the Hub at fixed revisions.PATIENT'S PHONEBrowserYOLOv8n-pose + MoveNetrun with ONNX RuntimeWeb on every frame.Live comments + voice.Camera video stayshere during the set.HUGGING FACE SPACEWathba app (FastAPI)Counts reps, scoresthe set, builds thereport.Checks every Qwenreply before showing it.Backup: runs Qwen3-4Bon its own T4 GPU.HUGGING FACE HUBModel filesYOLOv8n-pose, MoveNet,Qwen3-4B. Fixedrevisions, SHA256checked.HF INFERENCE PROVIDERSQwen3-4BWrites summaries andanswers. Signed inwith the Space’sHF_TOKEN secret.GET /api/configmodels and settingsGET /vendor/models/…pose model filesPOST /api/uploadrecording, after the setPOST /api/processtracked jointsPOST /api/workout/check-inpain and effort answersPOST …/ai/summary, /ai/askwith consentchecked replyhf_hub_downloadmodel files, at buildPOST /v1/chat/completionsnumbers + typed answerssummary text
  1. Phone ↔ SpaceGET /api/configModels and settings.
  2. Phone ← SpaceGET /vendor/models/…Pose model files. The phone then tracks every frame itself.
  3. Phone → SpacePOST /api/uploadThe recording, after the set.
  4. Phone → SpacePOST /api/processThe tracked joints. The Space counts reps and scores the set.
  5. Phone → SpacePOST /api/workout/check-inPain and effort answers.
  6. Phone → SpacePOST …/ai/summary, /ai/askOnly with the patient’s consent. The Space sends back a checked reply.
  7. Space → Inference ProvidersPOST /v1/chat/completionsQwen3-4B gets numbers and typed answers only. The Space’s own T4 GPU is the backup.
  8. Hub → Spacehf_hub_downloadModel files at fixed revisions, SHA256 checked, at build.
  9. 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.

Datasets

MPII Human Pose for pose training.

Models in the app

All three come from the Hub. Our fine-tuned YOLOv8n-pose, checked against the original Xenova/yolov8n-pose. MoveNet as the second pose model. Both run in the phone’s browser on every frame. Qwen3-4B-Instruct-2507 for summaries and answers.

Inference

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.

Datasets

MPII Human Pose

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.

Joint accuracy before and afterAccuracy for each body part for the current and fine-tuned models, with 95 percent intervals.CurrentFine-tuned0%25%50%75%100%Hips60 to 66%Knees48 to 52%Ankles43 to 49%Shoulders73 to 77%Elbows63 to 67%Wrists63 to 65%
Accuracy by body part, with 95% intervals. Left and right sides are combined.
Hip, knee and ankle accuracy at every error toleranceAccuracy rises with allowed error. The fine-tuned line is compared with the current line.CurrentFine-tuned0%20%40%60%0.10.20.30.40.5Allowed error, in head lengths51%56%
Hip, knee and ankle accuracy at each allowed error.
Hip, knee and ankle accuracy for each test photo133 photos improved, 116 stayed the same and 79 got worse.Improved (133)Same (116)Worse (79)0%0%25%25%50%50%75%75%100%100%Current model: hip, knee and ankle accuracy per photoDots above the dashed line improved. Bigger dots hold more photos.
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.

Current model: predicted against true hip-to-ankle distanceEach dot is one person. R squared 0.793, average error 0.44 head lengths.Current modelR² 0.793, average error 0.44 head lengths-4-4-2-200224466Dashed: perfect matchSolid: fitted lineTrue distance, in head lengths
Fine-tuned model: predicted against true hip-to-ankle distanceEach dot is one person. R squared 0.755, average error 0.42 head lengths.Fine-tuned modelR² 0.755, average error 0.42 head lengths-4-4-2-200224466Dashed: perfect matchSolid: fitted lineTrue distance, in head lengths

Training

Training lossPose error on training photos, lower is betterTraining lossPose error on training photos, lower is better0123411020304050Harder imagemixing stopsEpoch
Validation scorePose score on unseen activities, higher is betterValidation scorePose score on unseen activities, higher is better0.60.70.80.911020304050Epoch
Show the numbers
Body partCurrent95% intervalFine-tuned95% interval
Hips60.4%55.5 to 65.565.6%60.4 to 70.5
Knees48.0%42.9 to 52.951.7%46.8 to 56.7
Ankles43.4%38.3 to 48.349.2%44.0 to 54.0
Shoulders72.6%68.0 to 77.377.2%72.6 to 81.9
Elbows63.1%58.7 to 67.967.2%62.6 to 71.9
Wrists62.5%58.2 to 66.765.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.

Joint accuracy, round 1 and round 2Accuracy for each body part with 95 percent intervals.Round 1Round 20%25%50%75%100%Hips66 to 69%Knees52 to 57%Ankles49 to 53%Shoulders77 to 80%Elbows67 to 72%Wrists65 to 70%
Accuracy by body part, with 95% intervals. Left and right sides are combined.
Hip, knee and ankle accuracy at each error toleranceThree lines for the original model, round 1 and round 2.OriginalRound 1Round 20%20%40%60%0.10.20.30.40.5Allowed error, in head lengths51%56%60%
Hip, knee and ankle accuracy at each allowed error, for all three models.
Hip, knee and ankle accuracy for each test photo118 photos improved, 148 stayed the same and 62 got worse.Improved (118)Same (148)Worse (62)0%0%25%25%50%50%75%75%100%100%Round 1: hip, knee and ankle accuracy per photoDots above the dashed line improved. Bigger dots hold more photos.
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.

Round 1: predicted against true hip-to-ankle distanceEach dot is one person. R squared 0.822, average error 0.39 head lengths.Round 1R² 0.822, average error 0.39 head lengths-4-4-2-200224466Dashed: perfect matchSolid: fitted lineTrue distance, in head lengths
Round 2: predicted against true hip-to-ankle distanceEach dot is one person. R squared 0.883, average error 0.34 head lengths.Round 2R² 0.883, average error 0.34 head lengths-4-4-2-200224466Dashed: perfect matchSolid: fitted lineTrue distance, in head lengths

Training

Training lossPose error on training photos, lower is betterTraining lossPose error on training photos, lower is better012341255075100Harder imagemixing stopsEpoch
Validation scorePose score on unseen activities, higher is betterValidation scorePose score on unseen activities, higher is better0.20.40.60.811255075100Epoch
Show the numbers
ModelLeg accuracyPeople foundUsable leg jointsPeople found, browser version
Original51.1%88.3%50.0%85.6%
Round 155.9%90.8%55.3%90.4%
Round 260.3%90.4%59.7%89.7%

Body partRound 195% intervalRound 295% interval
Hips65.6%60.4 to 70.569.2%64.2 to 74.1
Knees51.7%46.8 to 56.757.2%52.2 to 61.8
Ankles49.2%44.0 to 54.053.2%47.6 to 58.4
Shoulders77.2%72.6 to 81.980.1%75.5 to 84.6
Elbows67.2%62.6 to 71.971.9%67.3 to 76.5
Wrists65.0%60.7 to 69.870.4%66.1 to 74.8

Pitch deck

The pitch

1 / 14

Download the deck (.pptx)