From ac5a7f145e9e75a29cf68a624a56bf1e5375ef68 Mon Sep 17 00:00:00 2001 From: yeshanliu <41566254+yeshanliu@users.noreply.github.com> Date: Fri, 1 Apr 2022 11:40:18 +0800 Subject: [PATCH] Update detect.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ”cv2.imencode()“ Chinese image save paths fix --- detect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detect.py b/detect.py index 14ff9a6ab421..9c72a713417d 100644 --- a/detect.py +++ b/detect.py @@ -179,7 +179,7 @@ def run( # Save results (image with detections) if save_img: if dataset.mode == 'image': - cv2.imwrite(save_path, im0) + cv2.imencode('.jpg', im0)[1].tofile(save_path) else: # 'video' or 'stream' if vid_path[i] != save_path: # new video vid_path[i] = save_path