more effectively multithread

This commit is contained in:
2024-04-05 12:23:11 +02:00
parent 35cfa8a906
commit 81475815fb
2 changed files with 37 additions and 15 deletions

View File

@ -42,13 +42,11 @@ Yolo::Yolo(const std::filesystem::path &onnxModelPath, const cv::Size &modelInpu
}
if(runWithOCl)
{
std::cout << "\nRunning on OCV" << std::endl;
net.setPreferableBackend(cv::dnn::DNN_BACKEND_DEFAULT);
net.setPreferableTarget(cv::dnn::DNN_TARGET_OPENCL);
}
else
{
std::cout << "\nRunning on CPU" << std::endl;
net.setPreferableBackend(cv::dnn::DNN_BACKEND_OPENCV);
net.setPreferableTarget(cv::dnn::DNN_TARGET_CPU);
}