feat: Unified Ingest SDK for DMS/ADAS promote, cuboid export and 3D fit
Replace subprocess build with promote_batch SDK, add ADAS cuboid export/fit/validate pipeline, stage normalization, and offline unit tests wired into smoke_labeling_api. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -264,6 +264,35 @@ def resolve_approval_scope(action: str, params: dict[str, Any]) -> dict[str, Any
|
||||
"batches": batches,
|
||||
}
|
||||
|
||||
if action == "build_adas":
|
||||
task = p.get("task") or "cuboid_7cls"
|
||||
batch_name = p.get("batch")
|
||||
root = proj_root(wf, "adas")
|
||||
batches: list[dict[str, Any]] = []
|
||||
if batch_name:
|
||||
batches.append({"path": root / "inbox" / task / batch_name, "batch": batch_name, "location": "inbox"})
|
||||
pack = p.get("pack") or "adas_moon3d_v1"
|
||||
stats: dict[str, Any] = {}
|
||||
if batch_name:
|
||||
from as_platform.data.promote.validate.adas_cuboid import validate_adas_cuboid_batch
|
||||
|
||||
bpath = root / "inbox" / task / batch_name
|
||||
if bpath.is_dir():
|
||||
_err, _warn, stats = validate_adas_cuboid_batch(bpath, allow_partial_3d=True)
|
||||
from as_platform.labeling.class_map import load_adas_class_names
|
||||
|
||||
names = load_adas_class_names()
|
||||
class_names = {i: n for i, n in enumerate(names)}
|
||||
return {
|
||||
"project": "adas",
|
||||
"task": task,
|
||||
"pack": pack,
|
||||
"scope_label": f"ADAS · {task} · {pack}" + (f" · {batch_name}" if batch_name else ""),
|
||||
"class_names": class_names,
|
||||
"batches": batches,
|
||||
"export_stats": stats,
|
||||
}
|
||||
|
||||
if action == "delivery_ingest":
|
||||
data_path = (p.get("data_path") or "").strip()
|
||||
if not data_path:
|
||||
|
||||
@@ -11,7 +11,7 @@ from as_platform.config import LANE_DATA_VIZ_ENABLED
|
||||
from as_platform.integrations.feishu_notify import send_chat_async
|
||||
|
||||
ACTIONS_REQUIRING_APPROVAL = {
|
||||
"build_dms", "build_lane", "enable_pack", "disable_pack",
|
||||
"build_dms", "build_adas", "build_lane", "enable_pack", "disable_pack",
|
||||
"train_dms", "train_lane", "eval_dms", "promote_dms",
|
||||
"pipeline_dms", "register_batch", "eval_lane", "visualize_dms", "visualize_lane",
|
||||
"delivery_ingest",
|
||||
@@ -31,6 +31,7 @@ REJECTION_CATEGORY_LABEL = {k: v for k, v in REJECTION_CATEGORIES.items()}
|
||||
|
||||
ACTION_LABELS = {
|
||||
"build_dms": "DMS 入库 (build)",
|
||||
"build_adas": "ADAS 入库 (build)",
|
||||
"build_lane": "车道线合并列表 (build lane)",
|
||||
"enable_pack": "启用训练数据包",
|
||||
"disable_pack": "停用训练数据包",
|
||||
|
||||
@@ -272,9 +272,10 @@ def _update_campaign_stage(db, campaign_id: str, new_stage: str) -> None:
|
||||
from as_platform.labeling.batch_stage import update_campaign_batch_meta_stage
|
||||
camp = db.get(LabelingCampaign, campaign_id)
|
||||
if camp:
|
||||
camp.status = new_stage
|
||||
effective = "labeling_submitted" if new_stage == "review_approved" else new_stage
|
||||
camp.status = effective
|
||||
db.flush()
|
||||
update_campaign_batch_meta_stage(camp, new_stage)
|
||||
update_campaign_batch_meta_stage(camp, effective)
|
||||
|
||||
|
||||
def review_progress(campaign_id: str) -> dict[str, int]:
|
||||
|
||||
Reference in New Issue
Block a user