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