From a5d2d4792abe932131230b1d163d408092188b63 Mon Sep 17 00:00:00 2001 From: Francesco Gatti Date: Mon, 27 Jul 2020 13:52:39 +0200 Subject: [PATCH] fix coords convert --- src/Yolo3Detection.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Yolo3Detection.cpp b/src/Yolo3Detection.cpp index 27f393f..606c6d1 100644 --- a/src/Yolo3Detection.cpp +++ b/src/Yolo3Detection.cpp @@ -114,17 +114,17 @@ void Yolo3Detection::postprocess(const int bi, const bool mAP){ int y0 = (b.y-b.h/2.); int y1 = (b.y+b.h/2.); + // convert to image coords + x0 = x_ratio*x0; + x1 = x_ratio*x1; + y0 = y_ratio*y0; + y1 = y_ratio*y1; + for(int c=0; c= confThreshold) { int obj_class = c; float prob = dets[j].prob[c]; - // convert to image coords - x0 = x_ratio*x0; - x1 = x_ratio*x1; - y0 = y_ratio*y0; - y1 = y_ratio*y1; - tk::dnn::box res; res.cl = obj_class; res.prob = prob;