Skip to content

pyther-hub/object_detection_in_cplusplus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published