                  score_total += cv2.compareHist(img_list[i][1], img_list[j][1], distance)
              img_list[i][2] = score_total
  
          logger.info("Sorting...")
          img_list = sorted(img_list, key=operator.itemgetter(2), reverse=True)
          return img_list
  
      def sort_color(self):
          """ Score by channel average intensity """
          logger.info("Sorting by channel average intensity...")
          desired_channel = {'gray': 0, 'luma': 0, 'orange': 1, 'green': 2}
 
</s> remove                 score_total += cv2.compareHist(img_list[i][1], img_list[j][1], distance)
 </s> add                 score_total += cv2.compareHist(img_list[i][1],
                                               img_list[j][1],
                                               cv2.HISTCMP_BHATTACHARYYA) </s> remove         matched_list = list(zip(filename_list, blurs))
        img_list = sorted(matched_list, key=operator.itemgetter(1), reverse=True)
        return img_list
 </s> add         return sorted(blurs, key=lambda x: x[1], reverse=True) </s> remove         filename_list, image_list = self._get_images()

        logger.info("Estimating blur...")
        blurs = [self.estimate_blur(img) for img in image_list]
 </s> add  </s> remove         for i in tqdm(range(0, img_list_len), desc="Comparing", file=sys.stdout):
 </s> add         for i in tqdm(range(0, img_list_len), desc="Comparing histograms", file=sys.stdout):
        return sorted(img_list, key=lambda x: x[2], reverse=True)
                  score_total += cv2.compareHist(img_list[i][1], img_list[j][1], distance)
              img_list[i][2] = score_total
  
          logger.info("Sorting...")
        return sorted(img_list, key=lambda x: x[2], reverse=True)
        return sorted(img_list, key=lambda x: x[2], reverse=True)
  
      def sort_color(self):
          """ Score by channel average intensity """
          logger.info("Sorting by channel average intensity...")
          desired_channel = {'gray': 0, 'luma': 0, 'orange': 1, 'green': 2}
keep keep keep keep replace replace keep keep keep keep keep
 tools.sort
  - Add sort by size
  - Centralize some of the image loading routines 
tools/sort/sort.py