pyronear / pyronear/pyro-annotator
Bulk accept can send more than one smoke box per frame
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 2
Description
Follow-up from #286 / #318, which added a server-side validator rejecting more than one smoke box per detection annotation.
buildQuickSubmitPlan (frontend/src/utils/annotation/quickSubmitUtils.ts:143) calls materializeReviewAnnotation with rejected: new Set() and humanRects: [], so items.length === winningBoxes.length — every box on the frame's winning model layer becomes a smoke item. If a frame's winning layer ever holds two or more boxes, the bulk-accept flows all fail with a 422 and surface the generic toast "Failed to accept boxes — try again":
- per-object quick accept (
runLaneQuickAccept,LocalizeAlertPage.tsx:752) - "Accept remaining" from the accept popover
- "Accept all & submit alert"
The LocalizeObjectEditor is unaffected — it enforces one box client-side, and it is the escape hatch if this ever fires (open the frame, reject the extra box).
Measured on the dev database, 2026-08-06: zero affected frames. Max boxes on the winning layer is 1, across 288 auto-layer and 9,759 engine-layer frames. This is latent, not live.
Why it is not structurally prevented: worker.py's keep_boxes_overlapping retains every sensitive-model prediction that overlaps the lane's anchor, so a model change could start emitting two boxes on one frame. algo_predictions could likewise carry two.
What this needs: a rule for which box wins when the winning layer has more than one — highest confidence, or reuse focusOnMainObject (already used for display in collectLaneBoxes, quickSubmitUtils.ts:106, but deliberately not in the submit plan). Then cap the submit payload at one smoke box per frame and cover it with a frontend test.
Note this is the same "which box wins" question that blocks #315 on the sequence-annotation side, though the two are otherwise independent.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in frontend/src/utils/annotation/quickSubmitUtils.ts at buildQuickSubmitPlan and compare its winning-box handling with collectLaneBoxes and focusOnMainObject. Trace the callers in LocalizeAlertPage.tsx, then add a frontend test covering multiple boxes on a winning layer; done means each bulk-accept payload contains at most one smoke box per frame and the existing flows remain covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100