git clone https://github.com/wang-xinyu/tensorrtx
git reset --hard 4089c64
cp tensorrtrtx/gen_wts.py yolov5-3.1/
cd yolov5-3.1 && python3 gen_wts.py # output : yolov5s.wts
cp -a CMakeList.txt python yolov5_lib.cpp yolov5_lib.h tensorrtx/
cd tesorrtx && mkdir build && cd build && cmake ../ && make
cp yolov5s.wts tesorrtx/
cd tesorrtx/build && yolov5 -s # this will generate yolov5s.engine
yolov5 -d img_path
cd tesorrtx/python && python3 setup.py install
export LD_LIBRAR_PATH=$PWD/../build # path for libyolov5_trt.so
./python3 test.py