          size = self.get_cropped_size(old_centering)
          out = np.zeros((size, size, image.shape[-1]), dtype=image.dtype)
          slices = self.get_cropped_slices(old_centering)
          out[slices["out"][0], slices["out"][1], :] = image[slices["in"][0], slices["in"][1], :]
  
          # Revert back to the correct centering and size and reset the cache
          self._centering = old_centering
          self._size = old_size
          self._cache = self._set_cache()
          logger.trace("Cropped from aligned extract: (centering: %s, in shape: %s, out shape: %s)",
                       old_centering, image.shape, out.shape)
          return out
  
      @classmethod
 
</s> remove                      old_centering, image.shape, out.shape)
 </s> add                      self._centering, image.shape, out.shape) </s> remove         src_size = self.size - (self._size * _EXTRACT_RATIOS[self._centering])
        head_size = 2 * int(np.rint(src_size / (1 - _EXTRACT_RATIOS["head"]) / 2))
        if head_size != image.shape[0]:
            interp = cv2.INTER_CUBIC if image.shape[0] < head_size else cv2.INTER_AREA
            image = cv2.resize(image, (head_size, head_size), interpolation=interp)

        # store requested size + centering whilst temporary converting to full head extract
        old_centering = self._centering
        old_size = self.size
        self._centering = "head"
        self._size = image.shape[0]

        # crop the requested centering from image
        size = self.get_cropped_size(old_centering)
        out = np.zeros((size, size, image.shape[-1]), dtype=image.dtype)
        slices = self.get_cropped_slices(old_centering)
 </s> add         logger.trace("head_size: %s, image_size: %s, target_size: %s",
                     self._head_size, image.shape[0], self.size)
        if self._head_size != image.shape[0]:
            interp = cv2.INTER_CUBIC if image.shape[0] < self._head_size else cv2.INTER_AREA
            image = cv2.resize(image, (self._head_size, self._head_size), interpolation=interp)

        out = np.zeros((self.size, self.size, image.shape[-1]), dtype=image.dtype)
        slices = self._get_cropped_slices() </s> remove         cropped = np.zeros((batch.shape[0], size, size, batch.shape[3]), dtype=batch.dtype)

        for out, align, img in zip(cropped, aligned, batch):
            slices = align.get_cropped_slices(self._config["centering"])
            out[slices["out"][0], slices["out"][1], :] = img[slices["in"][0], slices["in"][1], :]
 </s> add         cropped = np.array([align.extract_face(img) for align, img in zip(aligned, batch)]) </s> remove         self._face = self._extract_face(image)
 </s> add         self._face = self.extract_face(image) </s> remove             size = aligned[0].get_cropped_size(self._config["centering"])
 </s> add             size = aligned[0].size
          size = self.get_cropped_size(old_centering)
          out = np.zeros((size, size, image.shape[-1]), dtype=image.dtype)
          slices = self.get_cropped_slices(old_centering)
          out[slices["out"][0], slices["out"][1], :] = image[slices["in"][0], slices["in"][1], :]





          logger.trace("Cropped from aligned extract: (centering: %s, in shape: %s, out shape: %s)",
                       old_centering, image.shape, out.shape)
          return out
  
      @classmethod
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 Bugfix - Warp to landmarks 
lib/align/aligned_face.py