Merge pull request #236 from xxxpsyduck/develop

If img is None then .shape method will raise an exception
This commit is contained in:
MissPenguin 2020-06-19 15:26:26 +08:00 committed by GitHub
commit bc462325b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -97,11 +97,8 @@ class EvalTestReader(object):
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)