Skip to content

Commit

Permalink
Merge pull request #236 from xxxpsyduck/develop
Browse files Browse the repository at this point in the history
If img is None then .shape method will raise an exception
  • Loading branch information
MissPenguin committed Jun 19, 2020
2 parents 1816241 + 98c80f1 commit bc46232
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions ppocr/data/det/dataset_traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,8 @@ def batch_iter_reader():
if img is None:
logger.info("{} does not exist!".format(img_path))
continue
if len(list(img.shape)) == 2 or img.shape[2] == 1:
elif 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
outs = process_function(img)
outs.append(img_path)
batch_outs.append(outs)
Expand Down

0 comments on commit bc46232

Please sign in to comment.