https://github.com/WongKinYiu/yolov7.git
python models/export.py --weights ../yolov7.pt --grid
python export.py -o onnx-name -e trt-name -p fp32/16/int8
cd yolov7
python trt.py
Please follow the TensorRT Installation Guide to install TensorRT.
And you should set the TensorRT path and CUDA path in CMakeLists.txt.
If you train your custom dataset, you may need to modify the value of num_class
.
const int num_class = 80;
Install opencv with sudo apt-get install libopencv-dev
(we don't need a higher version of opencv like v3.3+).
build the demo:
mkdir build
cd build
cmake ..
make
Then run the demo:
./yolov7 ../model_trt.engine -i ../../../../assets/dog.jpg
or
./yolov7 <path/to/your/engine_file> -i <path/to/image>