From 9b6f1205b2fd2dcc333db41e24f0b056ba01dba9 Mon Sep 17 00:00:00 2001 From: Feng Ni Date: Mon, 25 Jul 2022 17:04:03 +0800 Subject: [PATCH] fix cpp infer of jdetracker (#6502) --- deploy/cpp/src/tracker.cc | 4 ++-- deploy/pptracking/cpp/src/tracker.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/cpp/src/tracker.cc b/deploy/cpp/src/tracker.cc index b00e31c4e..f40cb0dd6 100644 --- a/deploy/cpp/src/tracker.cc +++ b/deploy/cpp/src/tracker.cc @@ -58,8 +58,8 @@ bool JDETracker::update(const cv::Mat &dets, const cv::Mat &emb, std::vector(i, 4); - const cv::Mat <rb_ = dets(cv::Rect(0, i, 4, 1)); + float score = *dets.ptr(i, 1); + const cv::Mat <rb_ = dets(cv::Rect(2, i, 4, 1)); cv::Vec4f ltrb = mat2vec4f(ltrb_); const cv::Mat &embedding = emb(cv::Rect(0, i, emb.cols, 1)); candidates[i] = Trajectory(ltrb, score, embedding); diff --git a/deploy/pptracking/cpp/src/tracker.cc b/deploy/pptracking/cpp/src/tracker.cc index 09b2dfa24..9540e39f6 100644 --- a/deploy/pptracking/cpp/src/tracker.cc +++ b/deploy/pptracking/cpp/src/tracker.cc @@ -56,8 +56,8 @@ bool JDETracker::update(const cv::Mat &dets, ++timestamp; TrajectoryPool candidates(dets.rows); for (int i = 0; i < dets.rows; ++i) { - float score = *dets.ptr(i, 4); - const cv::Mat <rb_ = dets(cv::Rect(0, i, 4, 1)); + float score = *dets.ptr(i, 1); + const cv::Mat <rb_ = dets(cv::Rect(2, i, 4, 1)); cv::Vec4f ltrb = mat2vec4f(ltrb_); const cv::Mat &embedding = emb(cv::Rect(0, i, emb.cols, 1)); candidates[i] = Trajectory(ltrb, score, embedding); -- GitLab