From cf0465596be74065979478f647462df03fee4314 Mon Sep 17 00:00:00 2001 From: "Victor M. Batlle" <736478@unizar.es> Date: Thu, 5 Dec 2019 00:01:19 +0100 Subject: [PATCH] Fix: "The truth value of an array with more than one element is ambiguous." (Python 2.7.15+) --- tools/evaluation_tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/evaluation_tools.py b/tools/evaluation_tools.py index bb8cff7..3beff45 100644 --- a/tools/evaluation_tools.py +++ b/tools/evaluation_tools.py @@ -52,7 +52,7 @@ def getImage(self, img_path): # Get and preprocess image # ---------------------------------------------------------------------- img = cv2.imread(img_path) - if img==None: + if img is None: print "img_path: ", img_path assert img!=None, "Image reading error. Check whether your image path is correct or not." img = cv2.resize(img, (self.image_width, self.image_height)) @@ -124,7 +124,7 @@ def getImage(self, img_path): # Get and preprocess image # ---------------------------------------------------------------------- img = cv2.imread(img_path) - if img==None: + if img is None: print "img_path: ", img_path assert img!=None, "Image reading error. Check whether your image path is correct or not." img = cv2.resize(img, (self.image_width, self.image_height))