train_palm.py 666 B

12345678910111213141516171819
  1. from ultralytics import YOLO
  2. def main():
  3. # 1. Load the YOLO26n model (Nano version for Mobile)
  4. model = YOLO("yolo26n.pt")
  5. # 2. Start Training
  6. model.train(
  7. data="data.yaml", # Points to your unified_dataset
  8. epochs=100, # 100 is a good baseline for R&D
  9. imgsz=640, # Standard mobile resolution
  10. batch=16, # Adjust based on your GPU VRAM
  11. name="palm_health_v1", # Folder name for results
  12. device=0, # Use '0' for NVIDIA GPU, or 'cpu'
  13. patience=20 # Stops early if the model stops improving
  14. )
  15. if __name__ == '__main__':
  16. main()