                            for img in tqdm(image_list, desc="Calculating...", file=sys.stdout)])
  
          logger.info("Sorting by ward linkage...")
          indices = self.vgg_face.sorted_similarity(preds, method="ward")
          img_list = np.array(filename_list)[indices]
          return img_list
  
      def sort_face_cnn(self):
          """ Sort by landmark similarity """
          logger.info("Sorting by landmark similarity...")
 
</s> remove         logger.info("Calculating face identifiers...")
        preds = np.array([self.vgg_face.predict(img)
                          for img in tqdm(image_list, desc="Calculating...", file=sys.stdout)])
 </s> add         # TODO This should be set in init
        self._loader = ImagesLoader(self.args.input_dir)

        filenames = []
        preds = np.empty((self._loader.count, 512), dtype="float32")
        for idx, (filename, image) in enumerate(tqdm(self._loader.load(),
                                                     desc="Classifying Faces...",
                                                     total=self._loader.count)):
            filenames.append(filename)
            preds[idx] = self.vgg_face.predict(image) </s> remove         filename_list, image_list = self._get_images()
 </s> add  </s> remove     exit(0)
 </s> add     sys.exit(0) </s> remove         free_ram = psutil.virtual_memory().free / divider
 </s> add         free_ram = psutil.virtual_memory().available / divider
        img_list = np.array(filenames)[indices]
                            for img in tqdm(image_list, desc="Calculating...", file=sys.stdout)])
  
          logger.info("Sorting by ward linkage...")
          indices = self.vgg_face.sorted_similarity(preds, method="ward")
        img_list = np.array(filenames)[indices]
          return img_list
  
      def sort_face_cnn(self):
          """ Sort by landmark similarity """
          logger.info("Sorting by landmark similarity...")
keep keep keep keep replace keep keep keep keep keep
 tools.sort - Optimize sort by face 
tools/sort.py