From 4a961cb0117b2586a55ebc20bc07f7e9ef8c7d20 Mon Sep 17 00:00:00 2001 From: Geralt_of_Rivia <87054407+guanjunwu@users.noreply.github.com> Date: Mon, 22 Jan 2024 12:52:43 +0800 Subject: [PATCH] fix loading error in folder format --- run.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/run.py b/run.py index 67def6fa..2f17df1e 100644 --- a/run.py +++ b/run.py @@ -57,7 +57,6 @@ NormalizeImage(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]), PrepareForNet(), ]) - if os.path.isfile(args.img_path): if args.img_path.endswith('txt'): with open(args.img_path, 'r') as f: @@ -66,8 +65,8 @@ filenames = [args.img_path] else: filenames = os.listdir(args.img_path) - filenames = [os.path.join(args.img_path, filename) for filename in filenames] filenames.sort() + filenames = [os.path.join(args.img_path, filename) for filename in filenames] for filename in tqdm(filenames): raw_image = cv2.imread(filename)