Merge pull request #233 from LDOUBLEV/fixocr

fix img shape not match when concat
This commit is contained in:
dyning 2020-06-19 10:26:44 +08:00 committed by GitHub
commit dfa00e1a70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -94,6 +94,8 @@ class EvalTestReader(object):
batch_outs = [] batch_outs = []
for img_path in img_list: for img_path in img_list:
img = cv2.imread(img_path) 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: if img is None:
logger.info("load image error:" + img_path) logger.info("load image error:" + img_path)
continue continue