From 9618d5fc7fc158eea87f8300d35b1c80b1f388e2 Mon Sep 17 00:00:00 2001 From: Micaela Verucchi Date: Tue, 19 May 2020 16:33:45 +0200 Subject: [PATCH] Fix original size Signed-off-by: Micaela Verucchi --- include/tkDNN/DetectionNN.h | 5 +++-- src/CenternetDetection.cpp | 2 +- src/MobilenetDetection.cpp | 4 ++-- src/Yolo3Detection.cpp | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) 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;