          np_float = 24  # bytes size of a numpy float
          divider = 1024 * 1024  # bytes to MB
  
          free_ram = psutil.virtual_memory().available / divider
          linkage_required = (((item_count ** 2) * np_float) / 1.8) / divider
          vector_required = ((item_count * dims) * np_float) / divider
          logger.debug("free_ram: %sMB, linkage_required: %sMB, vector_required: %sMB",
                       int(free_ram), int(linkage_required), int(vector_required))
  
          if linkage_required < free_ram:
              logger.verbose("Using linkage method")
 
</s> remove             logger.verbose("Using linkage method")
 </s> add             logger.verbose("Using linkage method")  # type:ignore </s> remove     @classmethod
    def estimate_blur_fft(cls, image, metadata=None):
        """ Estimate the amount of blur a fft filtered image has.
 </s> add         if self._args.log_changes:
            self._changes[source] = destination </s> remove     def sorted_similarity(self, predictions, method="ward"):
        """ Sort a matrix of predictions by similarity.
 </s> add  </s> remove         if metadata is not None:
            alignments = metadata["alignments"]
            det_face = DetectedFace()
            det_face.from_png_meta(alignments)
            aln_face = AlignedFace(np.array(alignments["landmarks_xy"], dtype="float32"),
                                   image=image,
                                   centering="legacy",
                                   size=256,
                                   is_aligned=True)
            mask = det_face.mask["components"]
            mask.set_sub_crop(aln_face.pose.offset[mask.stored_centering],
                              aln_face.pose.offset["legacy"],
                              centering="legacy")
            mask = cv2.resize(mask.mask, (256, 256), interpolation=cv2.INTER_CUBIC)[..., None]
            image = np.minimum(aln_face.face, mask)
        if image.ndim == 3:
            image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
        blur_map = cv2.Laplacian(image, cv2.CV_32F)
        score = np.var(blur_map) / np.sqrt(image.shape[0] * image.shape[1])
        return score
 </s> add         try:
            if self._args.keep_original:
                copyfile(source, destination)
            else:
                os.rename(source, destination)
        except FileNotFoundError as err:
            logger.error("Failed to sort '%s' to '%s'. Original error: %s",
                         source, destination, str(err)) </s> remove     @staticmethod
    def calc_landmarks_face_yaw(flm):
        """ Calculate the amount of yaw in a face """
        var_l = ((flm[27][0] - flm[0][0])
                 + (flm[28][0] - flm[1][0])
                 + (flm[29][0] - flm[2][0])) / 3.0
        var_r = ((flm[16][0] - flm[27][0])
                 + (flm[15][0] - flm[28][0])
                 + (flm[14][0] - flm[29][0])) / 3.0
        return var_r - var_l
 </s> add     # Output methods
    def _output_non_grouped(self) -> None:
        """ Output non-grouped files.
        linkage_required = (((self._num_predictions ** 2) * np_float) / 1.8) / divider
        vector_required = ((self._num_predictions * dims) * np_float) / divider
          np_float = 24  # bytes size of a numpy float
          divider = 1024 * 1024  # bytes to MB
  
          free_ram = psutil.virtual_memory().available / divider
        linkage_required = (((self._num_predictions ** 2) * np_float) / 1.8) / divider
        vector_required = ((self._num_predictions * dims) * np_float) / divider
        linkage_required = (((self._num_predictions ** 2) * np_float) / 1.8) / divider
        vector_required = ((self._num_predictions * dims) * np_float) / divider
          logger.debug("free_ram: %sMB, linkage_required: %sMB, vector_required: %sMB",
                       int(free_ram), int(linkage_required), int(vector_required))
  
          if linkage_required < free_ram:
              logger.verbose("Using linkage method")
keep keep keep keep replace replace keep keep keep keep keep
 Overhaul sort:
  - Standardize image data reading and writing
  - Optimize loading (just one pass required)
  - Make all sort groups binnable (to greater or lesser results)
  - Add sort by pitch
  - Deprecate multiple options
  - linting, docs + locales 
plugins/extract/recognition/vgg_face2_keras.py