diff --git a/paddleocr.py b/paddleocr.py index fa7ab72e71..0f7dabd160 100644 --- a/paddleocr.py +++ b/paddleocr.py @@ -742,7 +742,7 @@ def preprocess_image(_image): if det and rec: ocr_res = [] - for idx, img in enumerate(imgs): + for img in imgs: img = preprocess_image(img) dt_boxes, rec_res, _ = self.__call__(img, cls, slice) if not dt_boxes and not rec_res: @@ -753,7 +753,7 @@ def preprocess_image(_image): return ocr_res elif det and not rec: ocr_res = [] - for idx, img in enumerate(imgs): + for img in imgs: img = preprocess_image(img) dt_boxes, elapse = self.text_detector(img) if dt_boxes.size == 0: @@ -765,7 +765,7 @@ def preprocess_image(_image): else: ocr_res = [] cls_res = [] - for idx, img in enumerate(imgs): + for img in imgs: if not isinstance(img, list): img = preprocess_image(img) img = [img]