feat: per-class autolabel params + frame-scoped class clear (REQ-180, REQ-181)

- REQ-181: class_params {name: {threshold?, iou_threshold?, min_box_frac?}}
  on /preview and /autolabel, per-class override table in both modals;
  empty overrides take the unchanged global path
- REQ-180: x button on each review sidebar class row clears that class on
  the current frame only via bulk-delete, no confirmation
- includes REQ-178 empty date-folder cycle fix (archive_index.py)
This commit is contained in:
asus committed 2026-10-01 17:01:54 +07:00
1 parent c244ab9795
commit 1a99f2ffe4
16 files changed
+372 -45

No files matched your search

+5 -1
View File
@@ -35,6 +35,7 @@ class AutolabelRequest(BaseModel):
resume: bool = False
append: bool = False
custom_model_path: Optional[str] = None
class_params: Optional[dict[str, dict[str, float]]] = None
class Exemplar(BaseModel):
box: list[float] # [cx, cy, w, h], normalized 0..1
@@ -53,6 +54,7 @@ class PreviewRequest(BaseModel):
# Preview-only — `autolabel.start` deliberately has no equivalent.
exemplars: Optional[list[Exemplar]] = None
exemplar_class_name: Optional[str] = None
class_params: Optional[dict[str, dict[str, float]]] = None
@router.post("/api/projects/{project_id}/batches")
@@ -116,7 +118,8 @@ def start_autolabel(batch_id: int, request: AutolabelRequest) -> dict:
engine=request.engine, engines=engine_list, class_ids=request.class_ids,
engine_classes=request.engine_classes,
target_class_names=request.target_class_names,
custom_model_path=request.custom_model_path)
custom_model_path=request.custom_model_path,
class_params=request.class_params)
except batch_store.BatchError as exc:
raise HTTPException(400, str(exc))
@router.post("/api/batches/inspect-model")
@@ -189,6 +192,7 @@ def preview_autolabel(batch_id: int, request: PreviewRequest) -> dict:
custom_model_path=request.custom_model_path,
exemplars=[e.model_dump() for e in request.exemplars or []],
exemplar_class_name=request.exemplar_class_name,
class_params=request.class_params,
)
return {"shapes": shapes}
except Exception as exc: