          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"])
  
          if self._extract_version > 1.0 and self._centering == "legacy":
              mask.set_sub_crop(self._cache[key]["aligned_face"].pose.offset["face"] * -1)
  
          logger.trace("Caching mask for: %s", filename)
          self._cache[key]["mask"] = mask
  
      def _add_localized_mask(self, filename, detected_face, area):
 
</s> remove         if self._centering == "legacy":
            crop_offset = reference_face.pose.offset["face"] * -1
 </s> add         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 </s> remove             mask.set_sub_crop(aln_face.pose.offset["face"] * -1)
 </s> add             mask.set_sub_crop(aln_face.pose.offset[mask.stored_centering] * -1, centering="legacy") </s> remove             mask.set_sub_crop(aln_face.pose.offset["face"] * -1)
 </s> add             mask.set_sub_crop(aln_face.pose.offset[mask.stored_centering] * -1, centering="legacy") </s> remove                 centering = "legacy" if self._alignments.version == 1.0 else "face"
 </s> add                 centering = "legacy" if self._alignments.version == 1.0 else mask.stored_centering </s> remove     def _get_mask(self, detected_face, predicted_mask, sub_crop_offset):
 </s> add     def _get_mask(self, detected_face, predicted_mask, centering, sub_crop_offset):
        mask.set_sub_crop(self._cache[key]["aligned_face"].pose.offset[mask.stored_centering] * -1,
                          self._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"])
  
        mask.set_sub_crop(self._cache[key]["aligned_face"].pose.offset[mask.stored_centering] * -1,
                          self._centering)
        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
  
      def _add_localized_mask(self, filename, detected_face, area):
keep keep keep keep replace replace keep keep keep keep keep
 Add support for different mask centering types 
lib/training/generator.py