from ultralytics import YOLO if __name__ == "__main__": model = YOLO('yolov12n.yaml') model.load("yolov12n.pt") # Train the model results = model.train( data='/Users/jsonxu/code/ai/train/6017/data.yaml', project='/Users/jsonxu/code/ai/train/6017', # 训练结果路径 name='result',# 训练结果名称 exist_ok=True, #如果为 True,则允许覆盖现有的项目/名称目录。这对迭代实验非常有用,无需手动清除之前的输出。 epochs=1, batch=16, imgsz=640, scale=0.5, # S:0.9; M:0.9; L:0.9; X:0.9 mosaic=1.0, mixup=0.0, # S:0.05; M:0.15; L:0.15; X:0.2 copy_paste=0.1, # S:0.15; M:0.4; L:0.5; X:0.6 )