Image Segmentation
PyTorch
English
painting-vision-robotics-kit
semantic-segmentation
robotics
edge-ai
construction-ai
autonomous-painting
wall-painting-robot
paint-coverage-estimation
building-facade
drywall
skirting-detection
window-detection
lidar
depth-validation
segformer
deeplabv3
Eval Results (legacy)
Upload smoke_test.py with huggingface_hub
Browse files- smoke_test.py +8 -3
smoke_test.py
CHANGED
|
@@ -15,10 +15,10 @@ from pathlib import Path
|
|
| 15 |
HERE = Path(__file__).resolve().parent
|
| 16 |
|
| 17 |
|
| 18 |
-
def run(command):
|
| 19 |
print(f"\n$ {' '.join(map(str, command))}", flush=True)
|
| 20 |
result = subprocess.run([sys.executable, *map(str, command)], cwd=HERE)
|
| 21 |
-
if result.returncode
|
| 22 |
raise SystemExit(f"smoke test step failed ({result.returncode}): {' '.join(map(str, command))}")
|
| 23 |
|
| 24 |
|
|
@@ -51,16 +51,21 @@ def main():
|
|
| 51 |
"--keepout-mask", args.output / "prediction_keepout.png",
|
| 52 |
"--uncertainty-mask", args.output / "prediction_uncertainty.png",
|
| 53 |
"--drywall-mask", args.output / "prediction_drywall.png",
|
|
|
|
|
|
|
| 54 |
"--json", args.output / "prediction.json"])
|
| 55 |
run(["robot_planner.py", "--paintable", args.output / "prediction_paintable.png",
|
| 56 |
"--keepout", args.output / "prediction_keepout.png",
|
| 57 |
"--stroke-width", "120", "--overlap", "0.2", "--margin", "20",
|
|
|
|
| 58 |
"--plan", args.output / "paint_plan.json", "--overlay", args.output / "paint_plan.png"])
|
| 59 |
run(["provenance.py", "build", "--data", args.data, "--out", args.output / "data_manifest.json"])
|
| 60 |
run(["provenance.py", "verify", "--data", args.data, "--manifest", args.output / "data_manifest.json"])
|
| 61 |
run(["safety_gate.py", "--prediction", args.output / "prediction.json", "--no-require-depth"])
|
|
|
|
|
|
|
| 62 |
|
| 63 |
-
print(f"\nsmoke test passed: audit + train + predict + plan + provenance + safety gate on {args.data}")
|
| 64 |
|
| 65 |
|
| 66 |
if __name__ == "__main__":
|
|
|
|
| 15 |
HERE = Path(__file__).resolve().parent
|
| 16 |
|
| 17 |
|
| 18 |
+
def run(command, ok_codes=(0,)):
|
| 19 |
print(f"\n$ {' '.join(map(str, command))}", flush=True)
|
| 20 |
result = subprocess.run([sys.executable, *map(str, command)], cwd=HERE)
|
| 21 |
+
if result.returncode not in ok_codes:
|
| 22 |
raise SystemExit(f"smoke test step failed ({result.returncode}): {' '.join(map(str, command))}")
|
| 23 |
|
| 24 |
|
|
|
|
| 51 |
"--keepout-mask", args.output / "prediction_keepout.png",
|
| 52 |
"--uncertainty-mask", args.output / "prediction_uncertainty.png",
|
| 53 |
"--drywall-mask", args.output / "prediction_drywall.png",
|
| 54 |
+
"--painted-mask", args.output / "prediction_confident_painted.png",
|
| 55 |
+
"--touchup-mask", args.output / "prediction_touchup.png",
|
| 56 |
"--json", args.output / "prediction.json"])
|
| 57 |
run(["robot_planner.py", "--paintable", args.output / "prediction_paintable.png",
|
| 58 |
"--keepout", args.output / "prediction_keepout.png",
|
| 59 |
"--stroke-width", "120", "--overlap", "0.2", "--margin", "20",
|
| 60 |
+
"--observe", args.output / "prediction_confident_painted.png", "--state", args.output / "progress.npz",
|
| 61 |
"--plan", args.output / "paint_plan.json", "--overlay", args.output / "paint_plan.png"])
|
| 62 |
run(["provenance.py", "build", "--data", args.data, "--out", args.output / "data_manifest.json"])
|
| 63 |
run(["provenance.py", "verify", "--data", args.data, "--manifest", args.output / "data_manifest.json"])
|
| 64 |
run(["safety_gate.py", "--prediction", args.output / "prediction.json", "--no-require-depth"])
|
| 65 |
+
# A one-epoch model should not sign a wall off; exit 1 (reject) is a valid answer, a crash is not.
|
| 66 |
+
run(["safety_gate.py", "--prediction", args.output / "prediction.json", "--signoff"], ok_codes=(0, 1))
|
| 67 |
|
| 68 |
+
print(f"\nsmoke test passed: audit + train + predict + plan + provenance + safety gate + sign-off on {args.data}")
|
| 69 |
|
| 70 |
|
| 71 |
if __name__ == "__main__":
|