File size: 328 Bytes
9457184
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
import os
from ultralytics import YOLO

# Load a pre-trained YOLO model (adjust model type as needed)
model = YOLO("yolo11n.yaml")  # n, s, m, l, x versions available

# Perform object detection on an image
results = model.train(data=os.path.join(ROOT_DIR, "config.yaml"), epochs=1)  # Can also use video, directory, URL, etc.