From c7fc147311942ed55856fa154ca435120b4c3da6 Mon Sep 17 00:00:00 2001 From: songzhangzhang Date: Tue, 30 May 2023 10:50:45 +0800 Subject: [PATCH] SDE_Detector: convert frame color format to rgb (#8284) predict_image() requires that the image is RGB format, but VideoCapture.read() returns BGR image, so we need to convert the frame to RGB format. --- deploy/pptracking/python/mot_sde_infer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deploy/pptracking/python/mot_sde_infer.py b/deploy/pptracking/python/mot_sde_infer.py index 5a2693eec..b1c8cb3c9 100644 --- a/deploy/pptracking/python/mot_sde_infer.py +++ b/deploy/pptracking/python/mot_sde_infer.py @@ -681,8 +681,9 @@ class SDE_Detector(Detector): if mot_skip_frame_num > 1 and frame_id > 0 and frame_id % mot_skip_frame_num > 0: reuse_det_result = True seq_name = video_out_name.split('.')[0] + frame_rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) mot_results = self.predict_image( - [frame], + [frame_rgb], visual=False, seq_name=seq_name, reuse_det_result=reuse_det_result, -- GitLab