cv::Mat frame = cv::imread("D:/python/my_yolov8_train_demo/31.png");
std::vector results;
std::shared_ptr detector(new YOLO11OpenVINODetector());
detector->initConfig("D:/python/my_yolov8_train_demo/nut_best.onnx", 0.25, 640, 640, false);
detector->detect(frame, results);
for (YOLODetBox dr : results) {
cv::Rect box = dr.box;
cv::putText(frame, cv::format("%s %f",classNames[dr.classId], dr.score), cv::Point(box.tl().x, box.tl().y - 10), cv::FONT_HERSHEY_SIMPLEX, .5, cv::Scalar(0, 0, 0));
}
cv::imshow("YOLO11 对象检测 + OpenVINO2023", frame);
cv::imwrite("D:/result.jpg", frame);
cv::waitKey(0);
cv::destroyAllWindows();
return 0;