Real time object detection with deployment of YOLOv5 through LibTorch C++ API
Real time object detection with deployment of YOLOv5 through LibTorch C++ API
Install OpenCV.
sudo apt-get install libopencv-dev
Install LibTorch.
wget https://download.pytorch.org/libtorch/nightly/cpu/libtorch-shared-with-deps-latest.zip
unzip libtorch-shared-with-deps-latest.zip
Edit "CMakeLists.txt" to configure OpenCV and LibTorch correctly.
Compile and run.
cd build
cmake ..
make
./../bin/YOLOv5LibTorch
Note: COCO-pretrained YOLOv5s model has been provided. For more pretrained models, see yolov5.