  
          self._sub_crop["size"] = crop_size
          self._sub_crop["slice_in"] = [slice(max(roi[1], 0), max(roi[3], 0)),
                                        slice(max(roi[0], 0), max(roi[2], 0))]
          self._sub_crop["slice_out"] = [slice(max(roi[1] * -1, 0),
                                               crop_size - max(0, roi[3] - self.stored_size)),
                                         slice(max(roi[0] * -1, 0),
                                               crop_size - max(0, roi[2] - self.stored_size))]
          logger.trace("src_size: %s, roi: %s, sub_crop: %s", src_size, roi, self._sub_crop)
  
      def _adjust_affine_matrix(self, mask_size, affine_matrix):
          """ Adjust the affine matrix for the mask's storage size
  
 
</s> remove                 slice_out = [slice(max(roi[1] * -1, 0), self._size - max(0, roi[3] - head_size)),
                             slice(max(roi[0] * -1, 0), self._size - max(0, roi[2] - head_size))]
 </s> add                 slice_out = [slice(max(roi[1] * -1, 0),
                                   self._size - min(self._size, max(0, roi[3] - self._head_size))),
                             slice(max(roi[0] * -1, 0),
                                   self._size - min(self._size, max(0, roi[2] - self._head_size)))] </s> remove                 head_size = self._head_size
 </s> add  </s> remove                 offset = self.pose.offset.get(centering, np.float32((0, 0)))  # legacy = 0,0
 </s> add                 offset = self.pose.offset.get(centering, np.float32((0, 0)))  # legacy = 0.0
        self._sub_crop["slice_out"] = [
            slice(max(roi[1] * -1, 0),
                  crop_size - min(crop_size, max(0, roi[3] - self.stored_size))),
            slice(max(roi[0] * -1, 0),
                  crop_size - min(crop_size, max(0, roi[2] - self.stored_size)))]

  
          self._sub_crop["size"] = crop_size
          self._sub_crop["slice_in"] = [slice(max(roi[1], 0), max(roi[3], 0)),
                                        slice(max(roi[0], 0), max(roi[2], 0))]
        self._sub_crop["slice_out"] = [
            slice(max(roi[1] * -1, 0),
                  crop_size - min(crop_size, max(0, roi[3] - self.stored_size))),
            slice(max(roi[0] * -1, 0),
                  crop_size - min(crop_size, max(0, roi[2] - self.stored_size)))]

        self._sub_crop["slice_out"] = [
            slice(max(roi[1] * -1, 0),
                  crop_size - min(crop_size, max(0, roi[3] - self.stored_size))),
            slice(max(roi[0] * -1, 0),
                  crop_size - min(crop_size, max(0, roi[2] - self.stored_size)))]

        self._sub_crop["slice_out"] = [
            slice(max(roi[1] * -1, 0),
                  crop_size - min(crop_size, max(0, roi[3] - self.stored_size))),
            slice(max(roi[0] * -1, 0),
                  crop_size - min(crop_size, max(0, roi[2] - self.stored_size)))]

        self._sub_crop["slice_out"] = [
            slice(max(roi[1] * -1, 0),
                  crop_size - min(crop_size, max(0, roi[3] - self.stored_size))),
            slice(max(roi[0] * -1, 0),
                  crop_size - min(crop_size, max(0, roi[2] - self.stored_size)))]

          logger.trace("src_size: %s, roi: %s, sub_crop: %s", src_size, roi, self._sub_crop)
  
      def _adjust_affine_matrix(self, mask_size, affine_matrix):
          """ Adjust the affine matrix for the mask's storage size
  
keep keep keep keep replace replace replace replace keep keep keep keep keep
 bugfix - lib.align - Fix edge case aligned face sub crop 
lib/align/detected_face.py