Skip to content

Commit

Permalink
Merge pull request #233 from LDOUBLEV/fixocr
Browse files Browse the repository at this point in the history
fix img shape not match when concat
  • Loading branch information
dyning authored Jun 19, 2020
2 parents 853a586 + d4b0bfd commit dfa00e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ppocr/data/det/dataset_traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ def batch_iter_reader():
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
Expand Down

0 comments on commit dfa00e1

Please sign in to comment.