                  offset = self.pose.offset.get(centering, np.float32((0, 0)))  # legacy = 0.0
                  offset -= self.pose.offset["head"]
                  offset *= (self._head_size - (self._head_size * _EXTRACT_RATIOS["head"]))
  
                  center = np.rint(offset + self._head_size / 2).astype("int32")
                  padding = self.size // 2
                  roi = np.array([center - padding, center + padding]).ravel()
                  logger.trace("centering: '%s', center: %s, padding: %s, sub roi: %s",
                               centering, center, padding, roi)
                  self._cache["cropped_roi"][0][centering] = roi
 
</s> remove                 offset -= self.pose.offset["head"]
                offset *= (self._head_size - (self._head_size * _EXTRACT_RATIOS["head"]))
 </s> add                 adjusted = offset - self.pose.offset["head"]
                adjusted *= (self._head_size - (self._head_size * _EXTRACT_RATIOS["head"])) </s> remove     @staticmethod
    def _resize(image, target_size):
 </s> add     @classmethod
    def _resize(cls, image, target_size):
                center = np.rint(adjusted + self._head_size / 2).astype("int32")
                  offset = self.pose.offset.get(centering, np.float32((0, 0)))  # legacy = 0.0
                  offset -= self.pose.offset["head"]
                  offset *= (self._head_size - (self._head_size * _EXTRACT_RATIOS["head"]))
  
                center = np.rint(adjusted + self._head_size / 2).astype("int32")
                  padding = self.size // 2
                  roi = np.array([center - padding, center + padding]).ravel()
                  logger.trace("centering: '%s', center: %s, padding: %s, sub roi: %s",
                               centering, center, padding, roi)
                  self._cache["cropped_roi"][0][centering] = roi
keep keep keep keep replace keep keep keep keep keep
 extract: mask - Delete any mask from outside of frame boundaries 
lib/align/aligned_face.py