From a44c2a699fbbfb93ba8efd5da48383aa0bdb54af Mon Sep 17 00:00:00 2001 From: WenmuZhou Date: Mon, 30 Nov 2020 16:48:51 +0800 Subject: [PATCH] Adapt to windows --- tools/infer/predict_det.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/infer/predict_det.py b/tools/infer/predict_det.py index efda0e46..c395502b 100755 --- a/tools/infer/predict_det.py +++ b/tools/infer/predict_det.py @@ -180,8 +180,8 @@ if __name__ == "__main__": count += 1 print("Predict time of %s:" % image_file, elapse) src_im = utility.draw_text_det_res(dt_boxes, image_file) - img_name_pure = image_file.split("/")[-1] - cv2.imwrite( - os.path.join(draw_img_save, "det_res_%s" % img_name_pure), src_im) + img_name_pure = os.path.split(image_file)[-1] + img_path = os.path.join(draw_img_save, "det_res_%s" % img_name_pure) + cv2.imwrite(img_path, src_im) if count > 1: print("Avg Time:", total_time / (count - 1)) -- GitLab