train.py 445 B

123456789101112131415161718
  1. from ultralytics import YOLO
  2. if __name__ == "__main__":
  3. model = YOLO('yolov12n.yaml')
  4. model.load("yolov12n.pt")
  5. # Train the model
  6. results = model.train(
  7. data='/Users/jsonxu/Desktop/yolov12/dataset/data.yaml',
  8. epochs=100,
  9. batch=16,
  10. imgsz=640,
  11. scale=0.5, # S:0.9; M:0.9; L:0.9; X:0.9
  12. mosaic=1.0,
  13. mixup=0.0, # S:0.05; M:0.15; L:0.15; X:0.2
  14. copy_paste=0.1, # S:0.15; M:0.4; L:0.5; X:0.6
  15. )