From ba3e397f0a35aa82733080c244032a54150da5a0 Mon Sep 17 00:00:00 2001 From: littletomatodonkey Date: Thu, 7 Jan 2021 14:23:13 +0000 Subject: [PATCH] fix get image list --- ppocr/utils/utility.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppocr/utils/utility.py b/ppocr/utils/utility.py index 28fbc2b1..29576d97 100755 --- a/ppocr/utils/utility.py +++ b/ppocr/utils/utility.py @@ -57,7 +57,7 @@ def get_image_file_list(img_file): elif os.path.isdir(img_file): for single_file in os.listdir(img_file): file_path = os.path.join(img_file, single_file) - if imghdr.what(file_path) in img_end: + if os.path.isfile(file_path) and imghdr.what(file_path) in img_end: imgs_lists.append(file_path) if len(imgs_lists) == 0: raise Exception("not found any img file in {}".format(img_file)) -- GitLab