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