From d4b0bfd6553ed3e4db4cdd719cb7aa3dc3a5d721 Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Thu, 18 Jun 2020 21:25:14 +0800 Subject: [PATCH] fix img shape not match when concat --- ppocr/data/det/dataset_traversal.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ppocr/data/det/dataset_traversal.py b/ppocr/data/det/dataset_traversal.py index ab635de3..d7c74078 100644 --- a/ppocr/data/det/dataset_traversal.py +++ b/ppocr/data/det/dataset_traversal.py @@ -94,6 +94,8 @@ class EvalTestReader(object): batch_outs = [] for img_path in img_list: img = cv2.imread(img_path) + if len(list(img.shape)) == 2 or img.shape[2] == 1: + img = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR) if img is None: logger.info("load image error:" + img_path) continue -- GitLab