Add opencv script, modified macro, add opencv section into readme

Signed-off-by: Micaela Verucchi <micaela.verucchi@unimore.it>
This commit is contained in:
Micaela Verucchi
2020-04-06 17:25:53 +02:00
parent dfdeb8b36e
commit 674c61d280
6 changed files with 17 additions and 9 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ bool Yolo3Detection::init(const std::string& tensor_path, const int n_classes) {
}
dets = tk::dnn::Yolo::allocateDetections(tk::dnn::Yolo::MAX_DETECTIONS, classes);
#ifndef OPENCV_CUDA
#ifndef OPENCV_CUDACONTRIB
checkCuda(cudaMallocHost(&input, sizeof(dnnType)*netRT->input_dim.tot()));
#endif
checkCuda(cudaMalloc(&input_d, sizeof(dnnType)*netRT->input_dim.tot()));
@@ -50,7 +50,7 @@ bool Yolo3Detection::init(const std::string& tensor_path, const int n_classes) {
void Yolo3Detection::preprocess(cv::Mat &frame)
{
#ifdef OPENCV_CUDA
#ifdef OPENCV_CUDACONTRIB
cv::cuda::GpuMat orig_img, img_resized;
orig_img = cv::cuda::GpuMat(frame);
cv::cuda::resize(orig_img, img_resized, cv::Size(netRT->input_dim.w, netRT->input_dim.h));