anjali2002's picture
Complete Code
03efa53
raw
history blame contribute delete
781 Bytes
from ultralytics import YOLO
#base model
model = YOLO("yolov8m.pt") #for better accuracy
model.train(
data="data.yaml",
epochs=45, # increased to allow better convergence
patience=20, # early stopping if no val improvement
imgsz=640, # image size FOR ACCURACY
batch=8,
conf=0.25, # initial THRESHOLD
name="detector",
augment=True, # enables data augmentation
auto_augment='randaugment',# advanced augmentation
lr0=0.001, # initial learning rate
cos_lr=True, # cosine learning rate schedule (smoother training)
save=True,
save_period=10, # save weights every 10 epochs
)