yolov11-tensorrt:基于 TensorRT 的 YOLOv11 目标检测加速项目

可用于实现高效实时的目标检测任务。该项目提供 YOLOv11 模型的 C++ 实现,通过 TensorRT API 优化推理性能,支持模型导出为 ONNX 格式及转换为 TensorRT 引擎,适用于图像和视频检测场景。【此简介由AI生成】

Branch1Tags0

YOLOv11-TensorRT

python cuda trt mit

This repository hosts a C++ implementation of the state-of-the-art YOLOv11 object detection model from ultralytics, leveraging the TensorRT API for efficient, real-time inference.

Installation

1. Clone the Repository

git clone https://github.com/spacewalk01/yolov11-tensorrt.git
cd yolov11-tensorrt

2. Install Dependencies

  • For Python: Install required Python dependencies using pip:

    pip install --upgrade ultralytics
    
  • For C++: Ensure that OpenCV and TensorRT are installed. Set the correct paths for these libraries in the CMakeLists.txt file.

3. Build the C++ Code

mkdir build && cd build
cmake ..
cmake --build . --config Release

Usage

Exporting the Model

  1. Modify the export.py script if needed to set the desired model name.

  2. Run the Python script to export the YOLOv11 model to ONNX format:

    python export.py
    

Running Inference

1. Create a TensorRT Engine

Convert the ONNX model to a TensorRT engine:

./yolov11-tensorrt.exe yolo11s.onnx ""

2. Run Inference on an Image

Perform object detection on an image:

./yolov11-tensorrt.exe yolo11s.engine "zidane.jpg"

3. Run Inference on a Video

Perform object detection on a video:

./yolov11-tensorrt.exe yolo11s.engine "road.mp4"

License

This project is licensed under the AGPL-3.0 License. See the LICENSE file for details.

Introduction

可用于实现高效实时的目标检测任务。该项目提供 YOLOv11 模型的 C++ 实现,通过 TensorRT API 优化推理性能,支持模型导出为 ONNX 格式及转换为 TensorRT 引擎,适用于图像和视频检测场景。【此简介由AI生成】

Customize your domain