feat: skip track forward on result overlap, not class presence (REQ-189)
Frame holding the tracked class is now annotated like any other; the run's result is dropped only when it intersects a same-class shape already there.
This commit is contained in:
1 parent
3eeb529e3d
commit
f5be7880b0
8 files changed
+86
-30
No files matched your search
+32
-1
@@ -1511,7 +1511,8 @@ read it.
|
||||
slice bound is computed from `Number(trackFrames)` so a string can never concatenate into the
|
||||
slice end; `slice(index+1, index+1+N)` and `slice(index+1)` both bounded; cancel lands as
|
||||
`cancelled — frame n may still be saved by the server` and keeps the shapes already written;
|
||||
skip check reads the `class_ids` array, not `annotation_count`; marks cleared at the start of
|
||||
skip check reads the `class_ids` array, not `annotation_count` — *that rule was later replaced
|
||||
by the post-run overlap test in the next task*; marks cleared at the start of
|
||||
every run; `Shift+T` deliberately **not** bound (a fat-fingered 500-frame GPU run is not worth
|
||||
a keystroke). Reviewer pass done — 4 findings fixed. **Still owed, user browser + GPU**: set
|
||||
N=3 → 3 shapes, reload → N remembered; to-end over the already-reviewed part of batch 19 →
|
||||
@@ -1534,6 +1535,36 @@ read it.
|
||||
snapshot left as history); **SAM3 actually finding the object in the next 5 frames needs
|
||||
the user's GPU run** — select a shape, press `T`, expect a shape on each of the next 5.
|
||||
|
||||
## Task — Track Forward skips on overlap, not on class presence (REQ-189 amended) `[DONE]`
|
||||
|
||||
- The old rule skipped a frame *before* SAM3 ran when it already held a shape of the tracked
|
||||
class, which contradicted REQ-189's own "each frame is an independent run": a second truck in
|
||||
the same frame could never be annotated. Amended to a duplicate test **after** the run.
|
||||
- `backend/review.py:intersects()` — any intersection between two normalized boxes (shared area
|
||||
> 0; edge touch is *not* an overlap), deliberately not IoU. `assist()` gained
|
||||
`dedupe: bool = False`: once the GPU lock is released and right before `add()`, an existing
|
||||
shape of the same class on that frame whose box intersects the result makes it answer
|
||||
`{"skipped": True}` and write nothing — no create-then-delete, no transient row.
|
||||
`backend/api/review.py:AssistRequest.dedupe` carries the flag; `False` keeps the single-shot
|
||||
box-assist path byte-identical.
|
||||
- `frontend/src/pages/ReviewPage.jsx:trackForward` — pre-skip on `class_ids` and the local
|
||||
`class_ids` union are gone, the call sends `dedupe: true`, and `{skipped: true}` lands in the
|
||||
banner as `skipped K overlapping <class>` plus the filmstrip dot `overlaps an existing <class>`.
|
||||
- `backend/batches.py:frames()` no longer ships `class_ids` (it was added for the pre-skip and
|
||||
died with it); `annotation_count` stays.
|
||||
- Docs: `requirements.md` REQ-189 skip sentence rewritten, `ui-spec.md` banner + thumb tooltip.
|
||||
- Cost accepted: a long run now pays a GPU call on **every** frame ahead, including frames that
|
||||
end up skipped, where the old pre-skip made those free. Only worth layering a cheap seed-box
|
||||
pre-skip back if that hurts.
|
||||
→ verify: **[DONE]** `uv run python` harness (mocked engine + temp PNG) — 6 `intersects`
|
||||
cases (edge-touch false, partial/contained/corner true, disjoint false) and 5 `assist()` paths:
|
||||
dedupe+overlap → `{"skipped": True}` with `add()` never called; other-class box → annotated;
|
||||
empty frame → annotated; `dedupe=False` → annotated; polygon annotation → skipped.
|
||||
`batches.frames()` run against the live DB (3737 rows, `class_ids` gone, `annotation_count`
|
||||
kept); `npm run build` green; `git diff --check` clean. **Still worth a GPU run:** track into a
|
||||
frame already holding an overlapping truck → banner `skipped K overlapping truck`, dot, count
|
||||
unchanged, while a frame holding a truck elsewhere gets its own second box.
|
||||
|
||||
## Known open points
|
||||
|
||||
- *Not closed by any task, by choice:* **any rebuild kills the running job.** Task 14's resume
|
||||
|
||||
Reference in new issue
Block a user