              Includes the key `landmarks` if landmarks are required for training and the key `masks`
              if the masks are required for training. """
          retval = dict()
  
          get_masks = self._model.config["learn_mask"] or self._model.config["penalized_mask_loss"]
          if not self._model.command_line_arguments.warp_to_landmarks and not get_masks:
              return retval
  
          alignments = _TrainingAlignments(self._model, self._images)
  
          if self._model.command_line_arguments.warp_to_landmarks:
 
</s> remove             Includes the key `landmarks` if landmarks are required for training and the key `masks`
            if the masks are required for training. """
 </s> add             Includes the key `landmarks` if landmarks are required for training, `masks` if masks
            are required for training, `masks_eye` if eye masks are required and `masks_mouth` if
            mouth masks are required. """ </s> remove         if get_masks:
 </s> add         if self._model.config["learn_mask"] or self._model.config["penalized_mask_loss"]: </s> remove         masks = targets[-1]
        for idx, tgt in enumerate(targets[:-1]):
 </s> add         if not self._model.config["penalized_mask_loss"] and additional_masks is None:
            logger.trace("No masks to compile. Returning targets")
            return targets

        if not self._model.config["penalized_mask_loss"] and additional_masks is not None:
            masks = additional_masks
        elif additional_masks is not None:
            masks = np.concatenate((masks, additional_masks), axis=-1)

        for idx, tgt in enumerate(targets): </s> remove         logger.debug(retval)
 </s> add         if self._model.config["eye_multiplier"] > 1:
            retval["masks_eye"] = alignments.masks_eye

        if self._model.config["mouth_multiplier"] > 1:
            retval["masks_mouth"] = alignments.masks_mouth

        logger.debug({key: {k: len(v) for k, v in val.items()} for key, val in retval.items()}) </s> remove         logger.trace("masks shape: %s", masks.shape)
        batch = np.concatenate((batch, masks), axis=-1)
 </s> add         Returns
        -------
        :class:`numpy.ndarray`
            The batch with masks applied to the final channels
        """
        logger.trace("Input batch shape: %s, side: %s", batch.shape, side)
        size = batch.shape[1]
        for key in ("masks", "eyes", "mouths"):
            item = self._masks[key]
            if item is None and key != "masks":
                continue
            if item is None and key == "masks":
                logger.trace("Creating dummy masks. side: %s", side)
                masks = np.ones_like(batch[..., :1], dtype=batch.dtype)
            else:
                logger.trace("Obtaining masks for batch. (key: %s side: %s)", key, side)
                masks = np.array([self._get_mask(item[side][filename], size)
                                  for filename, face in zip(filenames, batch)], dtype=batch.dtype)
                masks = self._resize_masks(size, masks)

            logger.trace("masks: (key: %s, shape: %s)", key, masks.shape)
            batch = np.concatenate((batch, masks), axis=-1)
        if not any([self._model.config["learn_mask"],
                    self._model.config["penalized_mask_loss"],
                    self._model.config["eye_multiplier"] > 1,
                    self._model.config["mouth_multiplier"] > 1,
                    self._model.command_line_arguments.warp_to_landmarks]):
              Includes the key `landmarks` if landmarks are required for training and the key `masks`
              if the masks are required for training. """
          retval = dict()
  
        if not any([self._model.config["learn_mask"],
                    self._model.config["penalized_mask_loss"],
                    self._model.config["eye_multiplier"] > 1,
                    self._model.config["mouth_multiplier"] > 1,
                    self._model.command_line_arguments.warp_to_landmarks]):
        if not any([self._model.config["learn_mask"],
                    self._model.config["penalized_mask_loss"],
                    self._model.config["eye_multiplier"] > 1,
                    self._model.config["mouth_multiplier"] > 1,
                    self._model.command_line_arguments.warp_to_landmarks]):
              return retval
  
          alignments = _TrainingAlignments(self._model, self._images)
  
          if self._model.command_line_arguments.warp_to_landmarks:
keep keep keep keep replace replace keep keep keep keep keep
 Add Mouth and Eye Priority to Loss options (#1054)

* Priority Training for Mouth and Eyes - Tensorflow

* Use chosen loss function for area multipliers

* loss multipliers for AMD

* Fix mask multipliers for plaid and roll PenalizedMaskLoss into LossWrapper

* losses_tf: roll PenalizedMaskLoss into LossWrapper 
plugins/train/trainer/_base.py