feat: Add support for ADAS project in labeling and export processes
- Implemented class name loading for ADAS campaigns in `_class_names_for_campaign`. - Enhanced annotation parsing to support cuboid and 2D rectangle labels in `_parse_ls_annotations`. - Updated catalog building to include ADAS packs and batches in `build_catalog_signature`. - Added ADAS cuboid promotion logic in `adas_cuboid.py`, supporting both quaternion_json and YOLO HBB formats. - Introduced validation for ADAS batches to check for YOLO HBB labels in `adas_cuboid.py`. - Modified delivery scanning to include ADAS project deliveries in `scan.py`. - Extended job execution to handle ADAS exports for YOLO format in `runner.py`. - Updated labeling export logic to accommodate ADAS project in `export_cuboid_batch.py`. - Enhanced format conversion to support rectangle labels in `format_converter.py`. - Improved CVAT task handling in `service.py` to ensure task ID updates on each labeling job. - Updated web API endpoints to reflect ADAS project changes in `hsap-api.ts`. - Added ADAS catalog types and UI components for displaying ADAS packs and batches in `dmsCatalog.ts`, `CatalogPage.tsx`, and `ExportPage.tsx`. - Adjusted workflow registry to align with new ADAS project structure.
This commit is contained in:
@@ -86,14 +86,20 @@ class AdasCuboidPromoteAdapter(PackPromoteAdapter):
|
||||
def promote(self, ctx: PromoteContext) -> PromoteResult:
|
||||
warnings = list(ctx.extra.get("validate_warnings") or [])
|
||||
qdir = ctx.batch_dir / "labels" / "quaternion_json"
|
||||
if not qdir.is_dir() or not any(qdir.glob("*.json")):
|
||||
has_quat = qdir.is_dir() and any(qdir.glob("*.json"))
|
||||
|
||||
# YOLO HBB 回退
|
||||
labels_dir = ctx.batch_dir / "labels"
|
||||
has_yolo = (labels_dir / "yolo-hbb").is_dir() and any((labels_dir / "yolo-hbb").glob("*.txt"))
|
||||
|
||||
if not has_quat and not has_yolo:
|
||||
return PromoteResult(
|
||||
ok=False,
|
||||
project=ctx.project,
|
||||
task=ctx.task,
|
||||
batch=ctx.batch,
|
||||
pack=ctx.pack,
|
||||
warnings=["missing quaternion_json export"],
|
||||
warnings=["missing quaternion_json or YOLO HBB export"],
|
||||
)
|
||||
|
||||
pack_dir = ctx.project_root / "packs" / ctx.pack
|
||||
@@ -119,7 +125,9 @@ class AdasCuboidPromoteAdapter(PackPromoteAdapter):
|
||||
if src_sub.is_dir():
|
||||
copied += _sync_tree(src_sub, dest / sub)
|
||||
|
||||
normalized = _normalize_quaternion_json(dest)
|
||||
normalized = _normalize_quaternion_json(dest) if has_quat else 0
|
||||
if has_yolo and not has_quat:
|
||||
warnings.append("using YOLO HBB labels (no quaternion_json)")
|
||||
|
||||
meta = read_meta(ctx.batch_dir) or {}
|
||||
meta.update({
|
||||
@@ -130,6 +138,7 @@ class AdasCuboidPromoteAdapter(PackPromoteAdapter):
|
||||
"pack": ctx.pack,
|
||||
"ingested_at": datetime.now(timezone.utc).isoformat(),
|
||||
"pipeline_version": 2,
|
||||
"label_format": "quaternion_json" if has_quat else "yolo_hbb",
|
||||
})
|
||||
write_meta(dest, meta)
|
||||
write_meta(ctx.batch_dir, meta)
|
||||
|
||||
Reference in New Issue
Block a user