Computer vision YOLO11 model

This commit is contained in:
Zuxin Dai
2025-01-24 10:04:59 -05:00
commit 2e6f7a8a1f
22 changed files with 476 additions and 0 deletions

19
Train_model.py Normal file
View File

@@ -0,0 +1,19 @@
from ultralytics import YOLO
import os
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
os.environ["CUDA_VISIBLE_DEVICES"]="0"
if __name__ == '__main__':
model = YOLO('yolo11n.pt')
results = model.train(
data = "D:\AIM\lemon\AIM.v3i.yolov11\data.yaml", # Path to the dataset (YAML file for COCO128)
epochs = 50, # Number of epochs for fine-tuning
imgsz = 640, # Image size for training
batch = 16, # Batch size
lr0 = 0.005, # Initial learning rate
workers = 4, # Number of data loading workers
device = 0 # Specify the device (0 = first GPU, 'cpu' for CPU)
)