              The swapped face with the requested mask added to the Alpha channel
          """
          logger.trace("Getting mask. Image shape: %s", new_face.shape)
          mask_centering = detected_face.mask[self._args.mask_type].stored_centering
          if self._centering != mask_centering:
              crop_offset = reference_face.pose.offset[mask_centering] * -1
          else:
              crop_offset = np.array((0, 0))
          mask, raw_mask = self._adjustments["mask"].run(detected_face, crop_offset, mask_centering,
                                                         predicted_mask=predicted_mask)
          if new_face.shape[2] == 4:
              logger.trace("Combining mask with alpha channel box mask")
              new_face[:, :, -1] = np.minimum(new_face[:, :, -1], mask.squeeze())
          else:
 
</s> remove 
        Notes
        -----
        All crops are for 'legacy` centering. This may change in future
 </s> add  </s> remove         mask.set_sub_crop(self._cache[key]["aligned_face"].pose.offset[mask.stored_centering] * -1,
 </s> add         pose = self._cache[key]["aligned_face"].pose
        mask.set_sub_crop(pose.offset[self._centering] - pose.offset[mask.stored_centering],
        crop_offset = (reference_face.pose.offset[self._centering] -
                       reference_face.pose.offset[mask_centering])
        mask, raw_mask = self._adjustments["mask"].run(detected_face, crop_offset, self._centering,
              The swapped face with the requested mask added to the Alpha channel
          """
          logger.trace("Getting mask. Image shape: %s", new_face.shape)
          mask_centering = detected_face.mask[self._args.mask_type].stored_centering
        crop_offset = (reference_face.pose.offset[self._centering] -
                       reference_face.pose.offset[mask_centering])
        mask, raw_mask = self._adjustments["mask"].run(detected_face, crop_offset, self._centering,
        crop_offset = (reference_face.pose.offset[self._centering] -
                       reference_face.pose.offset[mask_centering])
        mask, raw_mask = self._adjustments["mask"].run(detected_face, crop_offset, self._centering,
        crop_offset = (reference_face.pose.offset[self._centering] -
                       reference_face.pose.offset[mask_centering])
        mask, raw_mask = self._adjustments["mask"].run(detected_face, crop_offset, self._centering,
        crop_offset = (reference_face.pose.offset[self._centering] -
                       reference_face.pose.offset[mask_centering])
        mask, raw_mask = self._adjustments["mask"].run(detected_face, crop_offset, self._centering,
        crop_offset = (reference_face.pose.offset[self._centering] -
                       reference_face.pose.offset[mask_centering])
        mask, raw_mask = self._adjustments["mask"].run(detected_face, crop_offset, self._centering,
                                                         predicted_mask=predicted_mask)
          if new_face.shape[2] == 4:
              logger.trace("Combining mask with alpha channel box mask")
              new_face[:, :, -1] = np.minimum(new_face[:, :, -1], mask.squeeze())
          else:
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 Bugfix: Collect mask correctly in training and convert 
lib/convert.py