Skip to content

Latest commit

 

History

History
69 lines (50 loc) · 2.01 KB

INSTALL.md

File metadata and controls

69 lines (50 loc) · 2.01 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. Install Eigen referring to this guide. Maybe need administrative privileges.

  2. 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 a project:

    1. Windows:
    mkdir build
    cd build
    cmake ..
    cmake --build . --config Release
    1. Linux(not tested):
    mkdir build
    cd build && mkdir out_dir
    cmake ..
    make