Skip to content

Latest commit

 

History

History
63 lines (46 loc) · 1.79 KB

INSTALL.md

File metadata and controls

63 lines (46 loc) · 1.79 KB

Installation

  1. Clone YOLOv9 repo and install its requirements:
git clone https://github.com/WongKinYiu/yolov9
cd yolov9
pip install -r requirements.txt  
  1. Download yolov9-c.pt or yolov9-e.pt model.
  2. Convert the model to onnx format:
  • Put reparameterize.py file to YOLOv9 installation folder and perform re-parameterization:
python reparameterize.py yolov9-c.pt yolov9-c-converted.pt
python export.py --weights yolov9-c-converted.pt --include onnx
  1. Build a TensorRT engine:
trtexec.exe --onnx=yolov9-c-converted.onnx --explicitBatch --saveEngine=yolov9-c.engine --fp16
Note '--fp16' is an optional argument for performing inference using fp16 precision.
  1. Set opencv and tensorrt installation paths in CMakeLists.txt:
# Find and include OpenCV
set(OpenCV_DIR "your path to OpenCV")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})

# Set TensorRT path if not set in environment variables
set(TENSORRT_DIR "your path to TensorRT")
  1. Build the project:
mkdir build
cd build
cmake ..
cmake --build . --config Release

Tested Environment

  • TensorRT 8.6
  • CUDA 11.8
  • Windows 10