Skip to content

Webcam video stream with real-time YOLO object detection, built with Ort, Tonic and Axum.

Notifications You must be signed in to change notification settings

jordandelbar/yolo-tonic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e6e129e Β· Mar 16, 2025

History

70 Commits
Mar 2, 2025
Mar 4, 2025
Feb 17, 2025
Mar 16, 2025
Mar 15, 2025
Mar 15, 2025
Feb 22, 2025
Mar 1, 2025
Feb 16, 2025
Feb 16, 2025
Mar 2, 2025
Mar 2, 2025
Mar 3, 2025
Mar 3, 2025
Mar 3, 2025
Mar 3, 2025
Feb 18, 2025

Repository files navigation

YOLO Object Detection with Tonic and Axum

πŸ“ Overview

This project implements real-time object detection using a YOLO v8 model, a Rust gRPC service (Tonic + Ort) for inference, and an Axum-based middleware that streams video from a webcam, collects predictions, and serves them via Http. A simple HTML page is available to visualize the detections live from the webcam.

Alt text

πŸ› οΈ Tech Stack

  • Tonic, Ort for running YOLO model inference via gRPC using ONNX runtime
  • Axum, Tonic for handling video streaming and client Http requests
  • OpenCV for processing video frames in the middleware
  • HTML + JavaScript for real-time visualization

πŸ—οΈ Architecture

Alt text

οΈπŸ“¦ Installation

To run the project, simply execute the following command at the root directory:

make all

This will download the necessary images, runs the service and automatically open a webpage for visualization.

Running with CUDA support

If you have set up CUDA correctly, you can run the project with GPU acceleration by executing:

make all-cuda

🐧 OS Compatibility

Currently, the project only works on Linux as it relies on mounting the /dev/video1 device. If you are using a different video input, you may need to modify the source code accordingly.

πŸ“„ License

This project utilizes the YOLOv8m model, which is distributed under the AGPL-3.0 license. Please refer to the Ultralytics website for the full license details.

This project is intended for educational and demonstration purposes. Its licensing is subject to the licensing terms of the YOLOv8m model.

Disclaimer: Users are responsible for ensuring their compliance with the YOLOv8m model's license.