Linux配置 LibTorch 和 OpenCV
LibTorch
下载地址:https://pytorch.org/get-started/locally/
直接解压即可
OpenCV
下载地址:https://opencv.org/releases/
需要配置ffmpeg环境
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/workspace/dengzr/linux-x64/lib:/home/workspace/dengzr/ffmpeg-4.4-x86_64/lib/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/workspace/dengzr/linux-x64/lib/pkgconfig/:/home/workspace/dengzr/ffmpeg-4.4-x86_64/lib/pkgconfig/
mkdir build && cd build
cmake ../ -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/home/workspace/dengzr/linux-x64/
make
make install
运行yolov5模型
参考封装:https://github.com/ncdhz/YoloV5-LibTorch