cck-0702's picture
Clean commit without binary (image) files
c8c00f0
Raw
History Blame Contribute Delete
1.52 kB
import subprocess
import sys
# Common base arguments across all runs
BASE_CMD = [
sys.executable, # Uses the currently active Python interpreter
"batch_agent_orchestrator.py",
"--input-dir", r"C:\Users\admin_mtds\OneDrive\Desktop\ChinKuan\TestingImage\03_xray_solder",
"--output-dir", r"C:\Users\admin_mtds\OneDrive\Desktop\ChinKuan\ArtiAgent - DefectFill\agent_output\03_xray_solder",
"--checkpoint-dir", r"C:\Users\admin_mtds\OneDrive\Desktop\ChinKuan\ArtiAgent - DefectFill\engine\DefectFill\checkpoints",
"--product-desc", "X-ray PCB with solder joints and die components",
"--max-defects-per-image", "3",
"--guidance-scale", "8.0",
"--device", "cuda"
]
# Variations for each step in a single loop
# TASKS = [
# ["--defect-type", "tiger-strip"],
# ["--defect-type", "bubble"],
# [] # Default/No defect-type specified
# ]
TOTAL_LOOPS = 20
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)
print(f"\n--> Running command for Loop {loop_num}...")
# Run the base command and wait for it to finish
result = subprocess.run(BASE_CMD)
# Check if the command failed
if result.returncode != 0:
print(f"❌ Error encountered on Loop {loop_num}. Execution stopped.")
sys.exit(result.returncode)
print(f"\nπŸŽ‰ Success! Completed all {TOTAL_LOOPS} loops.")