C++OpenCV实现YOLO算法对目标进行检测实战

基本概念

        加载darknet框架的YoloV4模型做目标检测。OpenCV DNN模块支持常见深度学习框架如TensorFlowCaffe、Darknet等,对应的函数:readNetFromTensorflow、readNetFromCaffe.

// 加载darknet网络
Net net = readNetFromDarknet(config, weights);

YoloV4对应的权重和配置文件如下,下载地址

String config = "./model/yolov4.cfg";
String weights = "./model/yolov4.weights";
string classesFile = "./model/coco.names";

完整代码

#include
#include
#include 
#include 
#include
#include

using namespac

你可能感兴趣的:(C++OpenCV项目实战,深度学习实战代码40例,opencv,c++,目标检测)