Model prediction

Model prediction1. CLI usage2. Use Python2.1, USB cameraEffect preview2.2, CSI cameraEffect preview

1. CLI usage

CLI currently only supports calling USB cameras. CSI camera users can directly modify the previous python code to call onnx and ncnn models!

image-20250102163340185

image-20250102164847286

2. Use Python

Use Python to call USB camera and CSI camera to identify oranges.

2.1, USB camera

Use best.engine to predict the camera screen:

Run the code: Click the preview screen, press the q key to terminate the program!

Effect preview

Yolo recognizes the output video location: /home/pi/ultralytics/ultralytics/output/

image-20250102165136998

Sample code:

2.2, CSI camera

Use best.engine to predict the camera screen:

Run the code: Click the preview screen, press the q key to terminate the program!

Effect preview

Yolo recognizes the output video location: /home/pi/ultralytics/ultralytics/output/

Sample code: