hilaus-arm's picture
Sync from arm/Optimized-Runtimes via hub-sync
9422383 verified
|
Raw History Blame Contribute Delete
1.51 kB

Prerecorded-video example

This example performs object detection on prerecorded video. Video decoding and resizing complete before detection is timed, and annotated-video rendering runs afterward so neither is included in the reported model performance.

The example writes:

  • detections and per-frame timings to examples/video/output/detections.json;
  • an annotated video to examples/video/output/rendered.mp4.

Usage

Run these commands from the yolo26-raspberry-pi-5/ runtime directory.

Prerequisites

Install the required packages:

sudo apt update
sudo apt install --yes --no-install-recommends \
  ca-certificates \
  curl \
  git \
  make \
  python3 \
  python3-venv \
  tar \
  gzip

Using the sample video

The following command downloads a sample video and the pinned standard YOLO26n checkpoint, converts the model, and runs detection on the first 200 frames:

make example-video

The input is MediaPipe's object-detection test_video.mp4, Copyright 2019 The MediaPipe Authors, licensed under Apache-2.0.

Using your own video and model

The video must contain at least 200 decodable frames. Convert your model as described in Acquiring a model, then run:

make example-video VIDEO=/path/to/video.mp4

To use a converted model outside the default dist/models/ location, set MODEL explicitly:

make example-video \
  VIDEO=/path/to/video.mp4 \
  MODEL=/path/to/converted-model