diff --git a/include/tkDNN/DetectionNN.h b/include/tkDNN/DetectionNN.h index fc9a137..2e64be8 100644 --- a/include/tkDNN/DetectionNN.h +++ b/include/tkDNN/DetectionNN.h @@ -30,7 +30,7 @@ class DetectionNN { tk::dnn::NetworkRT *netRT = nullptr; dnnType *input_d; - cv::Size originalSize; + std::vector originalSize; cv::Scalar colors[256]; @@ -103,13 +103,14 @@ class DetectionNN { if(cur_batches > nBatches) FatalError("A batch size greater than nBatches cannot be used"); + originalSize.clear(); if(VERBOSE) printCenteredTitle(" TENSORRT detection ", '=', 30); { TIMER_START for(int bi=0; bipluginFactory->n_yolos; i++) rt_out[i] = (dnnType*)netRT->buffersRT[i+1] + netRT->buffersDIM[i+1].tot()*bi; - float x_ratio = float(originalSize.width) / float(netRT->input_dim.w); - float y_ratio = float(originalSize.height) / float(netRT->input_dim.h); + float x_ratio = float(originalSize[bi].width) / float(netRT->input_dim.w); + float y_ratio = float(originalSize[bi].height) / float(netRT->input_dim.h); // compute dets nDets = 0;