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:
63
scripts/smoke_adas_promote.sh
Executable file
63
scripts/smoke_adas_promote.sh
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env bash
|
||||
# ADAS cuboid export → 3D fit → promote smoke (val_front6mm_pilot)
|
||||
set -euo pipefail
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
BATCH="${AS_SMOKE_BATCH:-val_front6mm_pilot}"
|
||||
BATCH_DIR="${AS_SMOKE_BATCH_DIR:-$ROOT/../data/送标/adas/inbox/cuboid_7cls/$BATCH}"
|
||||
|
||||
export PYTHONPATH="$ROOT/platform:$ROOT"
|
||||
|
||||
python3 <<PY
|
||||
from pathlib import Path
|
||||
import json
|
||||
import sys
|
||||
|
||||
batch_dir = Path("$BATCH_DIR").resolve()
|
||||
if not batch_dir.is_dir():
|
||||
sys.exit(f"batch dir missing: {batch_dir}")
|
||||
|
||||
from as_platform.labeling.export_cuboid_batch import export_batch
|
||||
from as_platform.labeling.class_map import load_adas_class_names, build_class_map
|
||||
from as_platform.labeling.fit_cuboid_batch import fit_batch
|
||||
from as_platform.data.promote.runner import promote_batch
|
||||
|
||||
exp = export_batch(batch_dir)
|
||||
print("export", exp)
|
||||
assert exp.get("written", 0) > 0, "export wrote 0"
|
||||
|
||||
fit = fit_batch(batch_dir)
|
||||
print("fit", fit)
|
||||
|
||||
qfiles = list((batch_dir / "labels/quaternion_json").glob("*.json"))
|
||||
q = None
|
||||
for p in qfiles:
|
||||
d = json.loads(p.read_text())
|
||||
if d.get("detections"):
|
||||
q = p
|
||||
break
|
||||
assert q, "no quaternion json with detections"
|
||||
data = json.loads(q.read_text())
|
||||
det = data["detections"][0]
|
||||
names = load_adas_class_names()
|
||||
assert names[0] == "pedestrian", names
|
||||
assert det["class_name"] == "car"
|
||||
assert det["class_id"] == build_class_map(names)["car"], det
|
||||
|
||||
result = promote_batch(
|
||||
"adas",
|
||||
task="cuboid_7cls",
|
||||
batch=batch_dir.name,
|
||||
pack="adas_moon3d_v1",
|
||||
batch_dir=batch_dir,
|
||||
skip_validate=False,
|
||||
allow_partial_3d=True,
|
||||
)
|
||||
print("promote", result)
|
||||
|
||||
pack_root = Path("$ROOT/datasets/adas/packs/adas_moon3d_v1")
|
||||
dest = pack_root / "sources" / batch_dir.name
|
||||
assert dest.is_dir(), dest
|
||||
assert (dest / "labels" / "quaternion_json").is_dir()
|
||||
assert (pack_root / "lists" / "train_stems.txt").is_file()
|
||||
print("SMOKE_ADAS_PROMOTE_OK")
|
||||
PY
|
||||
@@ -10,6 +10,12 @@ python3 "$ROOT/datasets/dms/scripts/test_export_ls_to_yolo.py"
|
||||
echo "==> offline export_ls_to_lane_gt unit tests"
|
||||
python3 "$ROOT/datasets/lane/scripts/test_export_ls_to_lane_gt.py"
|
||||
|
||||
echo "==> offline unified ingest SDK unit tests"
|
||||
PYTHONPATH="$ROOT/platform:$ROOT" python3 "$ROOT/platform/as_platform/tests/test_unified_ingest_sdk.py"
|
||||
|
||||
echo "==> offline ADAS promote smoke (export/fit/promote)"
|
||||
bash "$ROOT/scripts/smoke_adas_promote.sh"
|
||||
|
||||
if [[ "${HSAP_API_SKIP:-0}" == "1" ]]; then
|
||||
echo "SKIP API tests (HSAP_API_SKIP=1)"
|
||||
echo "OK (offline only)"
|
||||
|
||||
Reference in New Issue
Block a user