          loss_funcs = []
          for idx, loss_name in enumerate(self.names):
              if loss_name.startswith("mask"):
                  loss_funcs.append(self.selected_mask_loss)
              elif self.mask_input is not None and self.config.get("penalized_mask_loss", False):
                  face_size = self.output_shapes[idx][1]
                  mask_size = self.mask_shape[1]
                  scaling = face_size / mask_size
                  logger.debug("face_size: %s mask_size: %s, mask_scaling: %s",
                               face_size, mask_size, scaling)
 
</s> remove             self.aligned["padding"] = padding
 </s> add             self.aligned["padding"] = self._padding_from_coverage(size, coverage_ratio) </s> remove         face = np.clip(face[:, :, :3] / 255., 0., 1.)
 </s> add  </s> remove         else:
 </s> add         elif self.passes == 3 and self.phase == 'align': </s> remove         p_type = "Detector" if self._plugin_type == "detect" else "Aligner"
        logger.info("Initializing %s %s...", self.name, p_type)
 </s> add         logger.info("Initializing %s in %s phase...", self.name, self._plugin_type) </s> remove             padding = int(size * self._extract_ratio) // 2
 </s> add 
            elif self.config["penalized_mask_loss"]:
          loss_funcs = []
          for idx, loss_name in enumerate(self.names):
              if loss_name.startswith("mask"):
                  loss_funcs.append(self.selected_mask_loss)
            elif self.config["penalized_mask_loss"]:
                  face_size = self.output_shapes[idx][1]
                  mask_size = self.mask_shape[1]
                  scaling = face_size / mask_size
                  logger.debug("face_size: %s mask_size: %s, mask_scaling: %s",
                               face_size, mask_size, scaling)
keep keep keep keep replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

Smart Masks - Initial Commit 
plugins/train/model/_base.py