c++ opencv调用yolov5 onnx模型

// ReadOnnx.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include
#include
#include
#include
#include
#include  
using namespace std;
using namespace cv;
using namespace dnn;

inline float sigmoid(float x)
{
    return 1.f / (1.f + exp(-x));
}

void drawPred(int classId, float conf, int left, int top, int right, int bottom, cv::Mat& frame,const std::vector& classes)
{
    cv::rectangle(frame, cv::Point(left, top), cv::Point(right, bottom), cv::Scalar(0, 255, 0), 3);
    std::string label = cv::format("%.2f", conf);
    if (!classes.empty()) {
        CV_Assert(classId < (int)classes.size());
        label = classes[classId] + ": " + labe

你可能感兴趣的:(pytorch,opencv,c++,计算机视觉)