On-device or server inference for live dance feedback: where the choice flips

Whether the pose model runs in the browser or on a server comes down to one number: how long the dancer can wait between a movement and the feedback it triggers. Below 100 ms, the network becomes part of the control loop, and anything that can stall that loop becomes a single point of failure. Above it, the server path stops being fragile and becomes the safer design.

The boundary is a 100 ms motion-to-feedback budget

In the on-device design the browser runs the pose model through WebGPU and scores locally. In the server design the client encodes video over WebRTC and a GPU node returns keypoints. Both sit on the same W3C browser media and compute APIs, but each puts its weakest link in a different place. When an on-screen cue, a mirrored skeleton or a correction arrow, must land within 100 ms of the movement, the server path has to fit encode, uplink, inference, downlink and render into that window, and uplink jitter on a congested mobile cell can use up the whole window on its own. That failure does not degrade gradually: the overlay lags, the dancer watches their own past, and the exercise is broken while every component reports healthy. On-device inference keeps the loop inside one process, so a dead network costs leaderboard sync and nothing else, and at this boundary on-device wins clearly.

How the on-device path fails, and how it recovers

The characteristic failure is GPU device loss: a driver reset, a thermal event or the OS reclaiming memory invalidates the WebGPU context mid-session, and every buffer and pipeline goes with it. A well-built client listens for the lost event, drops immediately to a WASM SIMD backend with a lighter model, and keeps timestamps continuous so scoring never sees a gap. It then rebuilds the GPU pipeline in the background, which by our estimate takes on the order of a second on a mid-range phone. The CPU fallback runs at perhaps a third of the GPU frame rate, also an estimate. That is enough to keep feedback going at lower fidelity instead of freezing it. Keypoints go to IndexedDB and upload when the network returns, so the server receives a complete session late rather than a partial one on time.

The rule for the design review

If the dancer must see feedback within 100 ms of the movement, put inference on the device and treat the server as an optional sink; if feedback can wait until the phrase is over, stream to the server and let the client be a capture device.

Above the boundary the server earns its place

Once feedback arrives after the phrase ends, as a score or a review, the latency argument disappears and the server design becomes the more resilient one. It buffers raw video through any outage, tolerates a throttled phone that only has to encode, and keeps a single model version under your control. It can also reprocess archived sessions when a better model ships, which an on-device pipeline that kept only keypoints can never do. Products that need live cues and later review both hit the next decision: whether to upload raw video alongside keypoints. That buys reprocessing at the cost of the bandwidth and consent burden the on-device design was meant to avoid.

Does a hybrid let us avoid choosing?

Only partly: on-device inference for live cues and server inference for scoring works, but you then maintain two models whose keypoints disagree slightly, and the score the dancer sees afterwards can contradict the cue they saw live.

Back to DanceRecognition · Domains

← Back to DanceRecognition
Engineering & Architecture Brief

On-device or server inference for live dance feedback: where the choice flips

Whether the pose model runs in the browser or on a server comes down to one number: how long the dancer can wait between a movement and the feedback it triggers. Below 100 ms, the network becomes part of the control loop, and anything that can stall that loop becomes a single point of failure. Above it, the server path stops being fragile and becomes the safer design.

The boundary is a 100 ms motion-to-feedback budget

In the on-device design the browser runs the pose model through WebGPU and scores locally. In the server design the client encodes video over WebRTC and a GPU node returns keypoints. Both sit on the same W3C browser media and compute APIs, but each puts its weakest link in a different place. When an on-screen cue, a mirrored skeleton or a correction arrow, must land within 100 ms of the movement, the server path has to fit encode, uplink, inference, downlink and render into that window, and uplink jitter on a congested mobile cell can use up the whole window on its own. That failure does not degrade gradually: the overlay lags, the dancer watches their own past, and the exercise is broken while every component reports healthy. On-device inference keeps the loop inside one process, so a dead network costs leaderboard sync and nothing else, and at this boundary on-device wins clearly.

How the on-device path fails, and how it recovers

The characteristic failure is GPU device loss: a driver reset, a thermal event or the OS reclaiming memory invalidates the WebGPU context mid-session, and every buffer and pipeline goes with it. A well-built client listens for the lost event, drops immediately to a WASM SIMD backend with a lighter model, and keeps timestamps continuous so scoring never sees a gap. It then rebuilds the GPU pipeline in the background, which by our estimate takes on the order of a second on a mid-range phone. The CPU fallback runs at perhaps a third of the GPU frame rate, also an estimate. That is enough to keep feedback going at lower fidelity instead of freezing it. Keypoints go to IndexedDB and upload when the network returns, so the server receives a complete session late rather than a partial one on time.

The rule for the design review

If the dancer must see feedback within 100 ms of the movement, put inference on the device and treat the server as an optional sink; if feedback can wait until the phrase is over, stream to the server and let the client be a capture device.

Above the boundary the server earns its place

Once feedback arrives after the phrase ends, as a score or a review, the latency argument disappears and the server design becomes the more resilient one. It buffers raw video through any outage, tolerates a throttled phone that only has to encode, and keeps a single model version under your control. It can also reprocess archived sessions when a better model ships, which an on-device pipeline that kept only keypoints can never do. Products that need live cues and later review both hit the next decision: whether to upload raw video alongside keypoints. That buys reprocessing at the cost of the bandwidth and consent burden the on-device design was meant to avoid.

Technical FAQ: Does a hybrid let us avoid choosing?

Only partly: on-device inference for live cues and server inference for scoring works, but you then maintain two models whose keypoints disagree slightly, and the score the dancer sees afterwards can contradict the cue they saw live.

More Technical Articles on dancerecognition.com

When dance feedback must survive the connection →