Skip to content

thomasza92/yolov11-face-trt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YOLOv11-Face TensorRT

📂 Project Structure

yolov11-face-trt/
├── CMakeLists.txt          # Build configuration for the project
├── include/                # Header files
├── dataset/                # INT8 quantization dataset goes here
├── models/                 # Models directory
│   ├── model.onnx          # YOLOv11-Face model
├── src/                    # Source directory
│   ├── yolov11.cpp         # YOLOv11 implementation
│   └── preprocess.cu       # CUDA preprocessing code
├── main.cpp                # Main entry point for the application
├── assets/                 # Images and benchmarks for README
└── build/                  # Compiled binaries

🛠️ Setup

Prerequisites

  • CMake (V3.30)
  • Ninja-Build (V1.12.1)
  • TensorRT (V10.9.0.34: For optimized inference)
  • CUDA Toolkit (V12.8: For GPU acceleration)
  • OpenCV (V4.11.0: For image and video processing)
  • NVIDIA GPU (Compute capability requirements tbd)
  • YOLOv11-Face (Download model here)
  • Dataset (Only required for INT8 quantization - download here)

Important

This project was only tested on Windows and is made for usage with NVIDIA GPUs!
You must include OpenCV bin on your PATH or copy the files to build directory!

Installation

  1. Clone the repository:
    git clone https://github.com/thomasza92/yolov11-face-trt.git
    cd yolov11-face-trt
    
  2. Update CUDA, TensorRT and OpenCV paths in CMakeLists.txt:
    set(CUDA_DIR "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.8")
    set(TENSORRT_DIR "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\TensorRT-10.9.0.34")
    set(OpenCV_DIR "C:\\Program Files\\OpenCV\\build")
    
  3. To build the project, open Developer Powershell for VS and run:
    mkdir build
    cd build
    cmake .. -G "Ninja"
    ninja
    

Note

If you have any problems building the project, please create a new issue.
I will try my best to resolve it there.

🚀 Usage

Convert ONNX Model to TensorRT Engine

To convert an ONNX model to a TensorRT engine file, use the following command:

./yolov11-face-trt convert model.onnx [--fp16|--int8]

Link to ONNX model is currently included in the models directory. Use --fp16 or --int8 args for model optimization.

Run Inference via Webcam

To run inference via webcam use the following command:

./yolov11-face-trt infer_webcam 0 model.engine

Run Inference on Video

To run inference on a video, use the following command:

./yolov11-face-trt infer_video video.mp4 model.engine

Run Inference on Image

Run Inference on Image To run inference on an image, use the following command:

./yolov11-face-trt infer_image image.jpg model.engine

🤝 Credits & Licensing

This project is a fork of another existing project.
All credits go to the original author.
All licensing information has been copied from there.

About

YOLOv11-Face with TensorRT

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 88.1%
  • Cuda 8.8%
  • CMake 2.2%
  • C 0.9%