|
@@ -63,7 +63,7 @@ class ModifiedPaddleOCR(PaddleOCR):
|
|
|
|
|
|
|
|
if det and rec:
|
|
if det and rec:
|
|
|
ocr_res = []
|
|
ocr_res = []
|
|
|
- for idx, img in enumerate(imgs):
|
|
|
|
|
|
|
+ for img in imgs:
|
|
|
img = preprocess_image(img)
|
|
img = preprocess_image(img)
|
|
|
dt_boxes, rec_res, _ = self.__call__(img, cls, mfd_res=mfd_res)
|
|
dt_boxes, rec_res, _ = self.__call__(img, cls, mfd_res=mfd_res)
|
|
|
if not dt_boxes and not rec_res:
|
|
if not dt_boxes and not rec_res:
|
|
@@ -75,7 +75,7 @@ class ModifiedPaddleOCR(PaddleOCR):
|
|
|
return ocr_res
|
|
return ocr_res
|
|
|
elif det and not rec:
|
|
elif det and not rec:
|
|
|
ocr_res = []
|
|
ocr_res = []
|
|
|
- for idx, img in enumerate(imgs):
|
|
|
|
|
|
|
+ for img in imgs:
|
|
|
img = preprocess_image(img)
|
|
img = preprocess_image(img)
|
|
|
dt_boxes, elapse = self.text_detector(img)
|
|
dt_boxes, elapse = self.text_detector(img)
|
|
|
if dt_boxes is None:
|
|
if dt_boxes is None:
|
|
@@ -96,7 +96,7 @@ class ModifiedPaddleOCR(PaddleOCR):
|
|
|
else:
|
|
else:
|
|
|
ocr_res = []
|
|
ocr_res = []
|
|
|
cls_res = []
|
|
cls_res = []
|
|
|
- for idx, img in enumerate(imgs):
|
|
|
|
|
|
|
+ for img in imgs:
|
|
|
if not isinstance(img, list):
|
|
if not isinstance(img, list):
|
|
|
img = preprocess_image(img)
|
|
img = preprocess_image(img)
|
|
|
img = [img]
|
|
img = [img]
|