feat: per-class max box fraction (REQ-188)

- labeling/preview/autolabel: max_box_frac + per-class max_box_fracs
  ceiling filter (0=none, 1=off) before NMS, mirrors min_box_frac
- exemplar review-assist: ceiling before max_detections truncation;
  ExemplarLabelRequest + filter panel 'Max box size' slider
- ClassParamsTable: MaxBox column; copy line now REQ-186 amended
  order: class <name> conf <v> iou <v> minbox <v> maxbox <v> container
- docs: design/ui-spec/tasks updated (incl. stale 4-slider narrative)
This commit is contained in:
asus committed 2026-10-02 17:27:11 +07:00
1 parent dee58e4ae5
commit d3a6aa49b6
13 files changed
+90 -25

No files matched your search

+9 -3
View File
@@ -37,6 +37,7 @@ DEFAULTS = {
"threshold": 0.5,
"iou_threshold": 0.8,
"min_box_frac": 0.002,
"max_box_frac": 1.0,
"max_detections": 100,
}
@@ -116,7 +117,8 @@ def _drop_negative_overlaps(frame_id: int, class_id: int,
def label(frame_id: int, class_id: int, exemplars: List[dict],
threshold: float = 0.5, iou_threshold: float = 0.8,
min_box_frac: float = 0.002, max_detections: int = 100,
min_box_frac: float = 0.002, max_box_frac: float = 1.0,
max_detections: int = 100,
apply: bool = False) -> dict:
"""Detect one class on one frame from the frame's exemplar pool.
@@ -189,12 +191,16 @@ def label(frame_id: int, class_id: int, exemplars: List[dict],
finally:
jobs.gpu_lock.release()
# The panel's filters, in the order the batch job applies them (REQ-175):
# area floor, then NMS, then the cap on how many survive.
# The panel's filters, in the order the batch job applies them (REQ-175/188):
# area floor, then ceiling, then NMS, then the cap on how many survive.
if min_box_frac > 0:
floor = width * height * min_box_frac
found = [d for d in found
if (d.box[2] - d.box[0]) * (d.box[3] - d.box[1]) >= floor]
if 0 < max_box_frac < 1:
ceiling = width * height * max_box_frac
found = [d for d in found
if (d.box[2] - d.box[0]) * (d.box[3] - d.box[1]) <= ceiling]
found = deduplicate(found, iou_threshold)
found.sort(key=lambda d: d.score, reverse=True)
if max_detections > 0: