Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 1.25 KB

README.md

File metadata and controls

59 lines (40 loc) · 1.25 KB

yolov7

C++ YOLO v7 ONNX Runtime inference code for object detection in a Video.

Dependecies:

  • OpenCV 4.x
  • ONNXRuntime 1.11+
  • OS: Tested on MacOS
  • CUDA 11+ [Optional]

Install:

brew install onnxruntime
brew install opencv

Build:

To build the project you should run the following commands.

mkdir build
cd build
cmake .. 
make

Run

Before running the executable you should convert your PyTorch model to ONNX if you haven't done it yet tutorial. On MacOS: to run the executable you should add OpenCV and ONNX Runtime libraries which we did using Homebrew

Change file path and names.

const std::string classNamesPath = "../models/coco.names"; 
const std::vector<std::string> classNames = utils::loadNames(classNamesPath);
const std::string videopath = "../videos/media01.mp4";   
const std::string modelPath = "../models/yolov7s.onnx";

Note:- current directory should be the build.

Run from CLI:

./yolo_ort

Output

  • img

References