File size: 807 Bytes
7bf5a8e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import subprocess
def run_script(script_path):
print(f"\n🔹 Đang chạy: {script_path}")
result = subprocess.run(["python", script_path], capture_output=True, text=True)
if result.returncode == 0:
print(f"✅ Hoàn thành: {script_path}\n")
else:
print(f"❌ Lỗi khi chạy {script_path}:\n{result.stderr}\n")
if __name__ == "__main__":
# Danh sách file cần chạy tuần tự
scripts = [
"segmentation/u2net_test.py",
"segmentation/sam_guide.py",
"segmentation/sam_predict.py",
"segmentation/make_final_mask.py",
"alopecia/calculate_hair_thickness.py",
"alopecia/calculate_hair_count.py"
]
for script in scripts:
run_script(script)
print("🎉 Hoàn tất toàn bộ quy trình!")
|