          mask = detected_face.mask[self._config["mask_type"]]
          mask.set_blur_and_threshold(blur_kernel=self._config["mask_blur_kernel"],
                                      threshold=self._config["mask_threshold"])
  
          mask.set_sub_crop(self._cache[key]["aligned_face"].pose.offset[mask.stored_centering] * -1,
                            self._centering)
  
          logger.trace("Caching mask for: %s", filename)
          self._cache[key]["mask"] = mask
  
 
</s> remove         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,
 </s> add         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, </s> remove 
        Notes
        -----
        All crops are for 'legacy` centering. This may change in future
 </s> add 
        pose = self._cache[key]["aligned_face"].pose
        mask.set_sub_crop(pose.offset[self._centering] - pose.offset[mask.stored_centering],
          mask = detected_face.mask[self._config["mask_type"]]
          mask.set_blur_and_threshold(blur_kernel=self._config["mask_blur_kernel"],
                                      threshold=self._config["mask_threshold"])
  
        pose = self._cache[key]["aligned_face"].pose
        mask.set_sub_crop(pose.offset[self._centering] - pose.offset[mask.stored_centering],
                            self._centering)
  
          logger.trace("Caching mask for: %s", filename)
          self._cache[key]["mask"] = mask
  
keep keep keep keep replace keep keep keep keep keep
 Bugfix: Collect mask correctly in training and convert 
lib/training/generator.py