From 05d380f9f166901be0d7cb31fda78ebcb54d2833 Mon Sep 17 00:00:00 2001 From: WannaSeaU <1473628258@qq.com> Date: Wed, 6 Mar 2019 10:53:02 +0800 Subject: [PATCH] Picture saving bug fixed. --- detect.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/detect.py b/detect.py index 4d6c5e76..dc7e28c3 100644 --- a/detect.py +++ b/detect.py @@ -295,16 +295,16 @@ def write(x, batches, results): cv2.rectangle(img, c1, c2,color, -1) cv2.putText(img, label, (c1[0], c1[1] + t_size[1] + 4), cv2.FONT_HERSHEY_PLAIN, 1, [225,255,255], 1) return img - - + + list(map(lambda x: write(x, im_batches, orig_ims), output)) - - det_names = pd.Series(imlist).apply(lambda x: "{}/det_{}".format(args.det,x.split("/")[-1])) - + + det_names = pd.Series(imlist).apply(lambda x: "{}/det_{}".format(args.det, (x.split("\\")[-1]).split('/')[-1])) + list(map(cv2.imwrite, det_names, orig_ims)) - + end = time.time() - + print() print("SUMMARY") print("----------------------------------------------------------") @@ -318,11 +318,11 @@ def write(x, batches, results): print("{:25s}: {:2.3f}".format("Average time_per_img", (end - load_batch)/len(imlist))) print("----------------------------------------------------------") - + torch.cuda.empty_cache() - - - - - - + + + + + +