Skip to content

fix: stop discarding finished signs while the classifier is busy - #35

Merged
Endika merged 1 commit into
mainfrom
fix/dropped-sign-windows
Aug 5, 2026
Merged

fix: stop discarding finished signs while the classifier is busy#35
Endika merged 1 commit into
mainfrom
fix/dropped-sign-windows

Conversation

@Endika

@Endika Endika commented Aug 5, 2026

Copy link
Copy Markdown
Owner

This is why nothing was ever recognised. Not the vocabulary — a dropped-frame bug.

const closedWindow = this.segmenter.push(frame);  // the sign ends on this frame
...
if (this.busy) return;                            // and here it is thrown away

A window closes on exactly one frame. If that frame arrived while a previous classification was still in flight, the entire sign was discarded — silently, with no error and no log.

And frames almost always arrive during a classification. Frames are delivered synchronously from requestAnimationFrame; the first one starts an async classify and yields, so every subsequent frame hits busy and returns early. On a phone running hand, pose and face inference per frame, the window-closing frame is essentially never the one holding the lock.

The finished sign is now queued in pendingWindow and picked up when the classifier frees, so a slow device recognises late rather than not at all.

The test earns its place

Reverting the fix fails two tests, not one — including the plain case with no artificial blocking. That is the measure of how broad this was: it was not an edge case on slow hardware, it was the normal path.

What I got wrong before this

I attributed the silence to vocabulary mismatch twice. It held for the first video — Presentación y Cortesía, greetings the model genuinely does not know — but the second was "En el Médico", squarely in the trained domain, and it should have worked. That is what stopped me repeating the explanation and made me read the frame loop.

Also measured on the way, since it was the other suspect and worth ruling out: at MIN_CONFIDENCE 0.45 the model speaks on 60.7% of held-out signs with 89.3% precision. The threshold was never what was keeping it quiet.

@Endika
Endika merged commit e35c899 into main Aug 5, 2026
7 checks passed
@Endika
Endika deleted the fix/dropped-sign-windows branch August 5, 2026 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant