          logger.info("Sorting by histogram dissimilarity...")
  
          img_list = [
              [img,
               cv2.calcHist([cv2.imread(img)], [0], None, [256], [0, 256]), 0]
              for img in
              tqdm(self.find_images(input_dir), desc="Loading", file=sys.stdout)
          ]
  
          img_list_len = len(img_list)
 
</s> remove             [img, cv2.calcHist([cv2.imread(img)], [0], None, [256], [0, 256])]
 </s> add             [img, cv2.calcHist([cv2_read_img(img, raise_error=True)], [0], None, [256], [0, 256])] </s> remove                  cv2.calcHist([cv2.imread(img)], [0], None, [256], [0, 256])]
 </s> add                  cv2.calcHist([cv2_read_img(img, raise_error=True)], [0], None, [256], [0, 256])] </s> remove         preds = np.array([self.vgg_face.predict(cv2.imread(img))
 </s> add         preds = np.array([self.vgg_face.predict(cv2_read_img(img, raise_error=True)) </s> remove             temp_list = [[img, self.estimate_blur(cv2.imread(img))]
 </s> add             temp_list = [[img, self.estimate_blur(cv2_read_img(img, raise_error=True))] </s> remove     img = cv2.imread(filename)  # pylint: disable=no-member
 </s> add     img = cv2_read_img(filename, raise_error=True)
             cv2.calcHist([cv2_read_img(img, raise_error=True)], [0], None, [256], [0, 256]), 0]
          logger.info("Sorting by histogram dissimilarity...")
  
          img_list = [
              [img,
             cv2.calcHist([cv2_read_img(img, raise_error=True)], [0], None, [256], [0, 256]), 0]
              for img in
              tqdm(self.find_images(input_dir), desc="Loading", file=sys.stdout)
          ]
  
          img_list_len = len(img_list)
keep keep keep keep replace keep keep keep keep keep
 Centralize cv2 image reading and handle bad filenames 
tools/sort.py