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
- 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!
- Clone the repository:
git clone https://github.com/thomasza92/yolov11-face-trt.git cd yolov11-face-trt - 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")
- 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.
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.
To run inference via webcam use the following command:
./yolov11-face-trt infer_webcam 0 model.engine
To run inference on a video, use the following command:
./yolov11-face-trt infer_video video.mp4 model.engine
Run Inference on Image To run inference on an image, use the following command:
./yolov11-face-trt infer_image image.jpg model.engine
This project is a fork of another existing project.
All credits go to the original author.
All licensing information has been copied from there.