Yolo 2
Yolo 2
# Load YOLOv8
model = YOLO("yolov8n.pt")
while True:
# Capture a frame from the camera
frame = picam2.capture_array()
# Run YOLO model on the captured frame and store the results
results = model(frame)
# Output the visual detection data, we will draw this on our camera preview
window
annotated_frame = results[0].plot()