      def sort_blur(self):
          """ Sort by blur amount """
          logger.info("Sorting by estimated image blur...")
  
          logger.info("Sorting...")
          return sorted(blurs, key=lambda x: x[1], reverse=True)
  
      def sort_face(self):
          """ Sort by identity similarity """
          logger.info("Sorting by identity similarity...")
 
</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         self._loader = FacesLoader(self._args.input_dir)  # TODO This should be set in init
 </s> add  </s> remove         img_list = sorted(img_list, key=operator.itemgetter(2), reverse=True)
        return img_list
 </s> add         return sorted(img_list, key=lambda x: x[2], reverse=True) </s> remove         filename_list, image_list = self._get_images()
        distance = cv2.HISTCMP_BHATTACHARYYA
 </s> add 
        # TODO We have metadata here, so we can mask the face for blur estimate
        blurs = [(filename, self.estimate_blur(image))
                 for filename, image, _ in tqdm(self._loader.load(),
                                                desc="Estimating blur",
                                                total=self._loader.count,
                                                leave=False)]
      def sort_blur(self):
          """ Sort by blur amount """
          logger.info("Sorting by estimated image blur...")
  
        # TODO We have metadata here, so we can mask the face for blur estimate
        blurs = [(filename, self.estimate_blur(image))
                 for filename, image, _ in tqdm(self._loader.load(),
                                                desc="Estimating blur",
                                                total=self._loader.count,
                                                leave=False)]
          logger.info("Sorting...")
          return sorted(blurs, key=lambda x: x[1], reverse=True)
  
      def sort_face(self):
          """ Sort by identity similarity """
          logger.info("Sorting by identity similarity...")
keep keep keep add keep keep keep keep keep keep
 tools.sort
  - Add sort by size
  - Centralize some of the image loading routines 
tools/sort/sort.py