Files
aicheckv2/test.py
2025-02-21 14:28:44 +08:00

20 lines
572 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import subprocess
def main():
data = 'D:\\syg\\yolov5\\datasets\\hqjvaj\\v1\\hqjvaj.yaml'
project = 'D:\\syg\\yolov5\\runs\\hqjvaj\\train'
name = 'v1'
epochs = 10
yolo_path = 'yolov5/train.py'
subprocess.run(["python", yolo_path, "--data=" + data, "--project="
+ project, "--name=" + name, "--epochs=" + str(epochs)], check=True)
if __name__ == "__main__":
"""
如果此脚本被直接运行则调用main()函数。
如果此脚本被其他脚本导入则不会自动调用main()。
"""
main()