feat: per-class exemplar preview, class hide toggle, container NMS flag (REQ-182, REQ-183, REQ-184)

This commit is contained in:
asus committed 2026-10-02 11:11:33 +07:00
1 parent 1a99f2ffe4
commit 96a00267d9
18 files changed
+537 -124

No files matched your search

+7 -1
View File
@@ -72,6 +72,10 @@ def preview_frame(
allowed_classes_set = {c.strip().lower() for c in target_class_names} if target_class_names else None
per_class = _parse_class_params(class_params)
predict_conf = min([threshold] + [v["threshold"] for v in per_class.values() if "threshold" in v])
# REQ-184: classes marked container keep boxes that sit inside them. The
# prompt pass below still sees prompt-index ids, so it gets the index-aligned set.
container_ids = {c["class_id"] for c in project["classes"] if c.get("container")}
prompt_container_ids = {i for i, c in enumerate(sam3_target_classes) if c.get("container")}
all_raw_detections = []
@@ -153,6 +157,7 @@ def preview_frame(
thresholds=thr_list,
iou_by_class=dict(enumerate(iou_list)) if iou_list else None,
min_box_fracs=mb_list,
container_ids=prompt_container_ids,
)
if not res.error and res.detections:
for det in res.detections:
@@ -169,7 +174,8 @@ def preview_frame(
and "iou_threshold" in per_class[c["name"].strip().lower()]
}
kept = labeling.deduplicate(all_raw_detections, iou_threshold=iou_threshold,
iou_by_class=iou_by_class_proj or None)
iou_by_class=iou_by_class_proj or None,
container_ids=container_ids)
items = []
for det in kept:
if project["label_type"] == "bbox" or det.mask is None: