yolov5-dnn-cpp-python icon indicating copy to clipboard operation
yolov5-dnn-cpp-python copied to clipboard

OpenCV开了cuda加速,但是没有提升,会是什么原因呢?

Open cucrui opened this issue 4 years ago • 0 comments

您好,opencv的cuda加速在yolact上很明显,大概有5倍的提升,但是在yolov5s上,几乎没有变化,想请教您可能是什么原因呢?非常感谢!

string modelFile = this->netname;
modelFile += ".onnx";
cout << "load modelFile : " << modelFile << endl; 
this->net = readNet(modelFile);
// 增加这两行用来加速 
this->net.setPreferableBackend(DNN_BACKEND_CUDA);
this->net.setPreferableTarget(DNN_TARGET_CUDA);

cucrui avatar May 19 '21 14:05 cucrui