OpenCV开了cuda加速,但是没有提升,会是什么原因呢?
cucrui opened this issue · comments
ICTQiuRui commented
您好,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);