Object detection - YOLOv8 Python lib

YOLOv8 - detection, segmentation and pose estimation with Pipeless

This example makes use of the Ultralytics YOLO Python package to perform object detection.

💡

This example uses YOLOv8 by importing the Ultralytics Python library, unlinke the onnx-yolo example, which loads the YOLO model into the ONNX Runtime.

Requirements

  • Pipeless: Check the installation guide.

  • Python OpenCV, NumPy and Ultralytics packages. Install them by running:

pip install opencv-python numpy ultralytics

Run the example

Create an empty Pipeless project

pipeless init my-project --template empty # Using the empty template we avoid the interactive shell
cd my-project

Feel free to change my-project by any name you want.

Download the stage folder

wget -O - https://github.com/pipeless-ai/pipeless/archive/main.tar.gz | tar -xz --strip=2 "pipeless-main/examples/yolo"

Start Pipeless

The following command leaves Pipeless running on the current terminal

pipeless start --stages-dir .

Provide a stream

Open a new terminal and run:

pipeless add stream --input-uri "v4l2" --output-uri "screen" --frame-path "yolo"

This command assumes you have a webcam available, if you don't just change the input URI.