Object Detection using YOLOv5 and OpenCV DNN (C++ and Python) Original Source
yolov5_opencv_python_cpp_demo.mp4
git clone --recursive https://github.com/majnas/yolov5_opencv_cpp_python.git
cd yolov5_opencv_cpp_python/yolov5
# Install dependencies.
pip install -r requirements.txt
pip install onnx
# Download .pt model.
cd models
wget https://github.com/ultralytics/YOLOv5/releases/download/v6.1/YOLOv5s.pt
# Export to ONNX
cd ..
python export.py --weights models/YOLOv5s.pt --include onnx
cd py
python main.py
Figure 1: python prediction for me.png
cd cpp
mkdir build
cd build
cmake ..
make
./app
Figure 2: cpp prediction for me.png