Object Detection on SL2610-Series
Complete the Getting Started guide first. It covers setting up your board, cloning the examples repository, creating the Python virtual environment, installing the shared dependencies and setting up the display environment. Activate the environment with source .venv/bin/activate in each new terminal.
Object Detection is a technique that helps computers find and label multiple objects in an image, like detecting people, cars, or animals in a photo. Whereas Image Classification associates a single label with a whole image, Object Detection uses bounding boxes around individual objects in an image. This makes tracking the position and behavior of objects in a scene possible.
YOLO (You Only Look Once) models
YOLO model, which stands for "You Only Look Once," is a type of computer vision model used for real-time object detection, where it identifies and locates objects within an image by processing it in a single pass, meaning it only needs to "look" at the image once to detect objects within it, making it very fast compared to methods that require multiple passes.
YOLO was originally created by Joseph Redmon in 2016, later transitioning to a community model with significant contributions by Ultralytics, their latest version being YOLO11.
Source: Ultralytics
Object Detection on the edge
Download the model
Install the example-specific dependencies and download the YOLOv8n model from Hugging Face:
cd object_detection/
pip install -r requirements.txt
python setup_demo.py
Offline? - Try offline dependencies installation
Python dependencies that are normally downloaded and installed with pip have been included for offline install. Install them with this command.
pip install --no-index --find-links=./wheelhouse -r requirements.txt
Run inference on single images
python3 run_cli.py --image ../samples/dog_bike_car.jpg
You should see a result in the form of:
[1/4] Preprocessing...
[2/4] Inference...
Time: 0.0359s
[3/4] Processing...
[4/4] Detections:
dog Conf: 0.8934 Box: [133 216 177 322]
bicycle Conf: 0.7886 Box: [138 150 425 267]
car Conf: 0.6292 Box: [465 76 260 93]

Run inference on camera or video input
run_cli.py also accepts video files, USB cameras and RTSP streams. Exactly one input source flag is required: --image, --video, --camera-device or --rtsp-url.
Connect a USB camera. To list the available cameras, run v4l2-ctl --list-devices. Then run inference on the camera input, using a device such as /dev/video0 or auto:
python3 run_cli.py --camera-device auto
Or run inference on a video file:
python3 run_cli.py --video <your_video>.mp4
Or on an RTSP stream such as an IP camera:
python3 run_cli.py --rtsp-url rtsp://<camera_ip>:<port>/<stream_path>
You can also pass the model, labels and device explicitly:
python3 run_cli.py \
--model ../models/Synaptics/yolov8-od-nano-320-int8-torq/yolo_od.vmfb \
--camera-device auto \
--labels labels.json \
--device torq
For a Coralboard with the Sensor Hat camera and a portrait display:
python3 run_cli.py \
--camera-device /dev/video0 \
--camera-control-device /dev/v4l-subdev2 \
--rotate 180 \
--display \
--exposure-auto 0
Additional options to try
--rotate {0,90,180,270}, rotate the camera or video feed clockwise (use--rotate 180if the camera is mounted upside down)--flip, flip the video input vertically--model, path to the model (default:../models/Synaptics/yolov8-od-nano-320-int8-torq/yolo_od.vmfb)--labels, path to the labels file (default:labels.json)--device, device to run on (default:torq)--output, Output video file--json-results, Output JSON file for detections--camera-width, USB camera width--camera-height, USB camera height--camera-fps, USB camera frame rate--display, Display annotated frames live--display-sink, GStreamer video sink for live display
Models
This tutorial uses the following pre-compiled models for the SL2610-Series. See the model pages for details, performance and download links:
Browse all models on the Models page.
Python walkthrough
This Python example uses the Torq runtime through SimpleVMFBInferenceRunner, a helper class for loading the model and running inferences.
The runner object is created like this:
runner = SimpleVMFBInferenceRunner(
args.model, device_uri=args.device, function="main", load_model_to_mem=True,
device_io=True,
)
Inference is started like this:
raw_out = runner.infer(input_data)
Review object_detection/run_cli.py and object_detection/vision.py to learn more.
The Python-based Torq runtime leverages Python bindings to the C++ Torq / IREE runtime.
