| import subprocess |
| import sys |
|
|
| |
| BASE_CMD = [ |
| sys.executable, |
| "batch_agent_orchestrator.py", |
| "--input-dir", r"C:\Users\admin_mtds\OneDrive\Desktop\ChinKuan\TestingImage\01_bubble_sensor", |
| "--output-dir", r"C:\Users\admin_mtds\OneDrive\Desktop\ChinKuan\ArtiAgent - Defect\agent_output", |
| "--defectdiffu-ckpt", r"C:\Users\admin_mtds\OneDrive\Desktop\ChinKuan\ArtiAgent - Defect\engine\DefectDiffu\checkpoint_old-4\model_300.pth", |
| "--vae-path", r"C:\Users\admin_mtds\OneDrive\Desktop\ChinKuan\ArtiAgent - Defect\engine\DefectDiffu\checkpoints\sd-vae-ft-mse", |
| "--product-desc", "VCSEL laser diode with emission aperture and surrounding mesa", |
| "--max-defects-per-image", "3", |
| "--device", "cuda" |
| ] |
|
|
| |
| TASKS = [ |
| ["--defect-type", "tiger-strip"], |
| ["--defect-type", "bubble"], |
| [] |
| ] |
|
|
| TOTAL_LOOPS = 16 |
|
|
| if __name__ == "__main__": |
| for loop_num in range(1, TOTAL_LOOPS + 1): |
| print(f"\n" + "=" * 50) |
| print(f"π STARTING LOOP {loop_num} OF {TOTAL_LOOPS}") |
| print("=" * 50) |
|
|
| for step_idx, task_args in enumerate(TASKS, start=1): |
| full_command = BASE_CMD + task_args |
| print(f"\n--> Running Task {step_idx}/3 for Loop {loop_num}...") |
| |
| |
| result = subprocess.run(full_command) |
|
|
| |
| if result.returncode != 0: |
| print(f"β Error encountered on Loop {loop_num}, Task {step_idx}. Execution stopped.") |
| sys.exit(result.returncode) |
|
|
| print("\nπ Success! Completed all 16 loops.") |