              raise FaceswapError(msg) from err
          loss = loss if isinstance(loss, list) else [loss]
          return loss
  
      def get_next(self):
          """ Return the next batch from the generator
              Items should come out as: (sample, warped, targets, [mask]) """
          logger.debug("Generating targets")
          batch = next(self.feed)
          targets_use_mask = self.model.training_opts["replicate_input_mask"]
 
</s> remove             Items should come out as: (sample, warped, targets, [mask]) """
        logger.debug("Generating targets")
 </s> add             Items should come out as: (warped, target [, mask]) """ </s> remove         targets_use_mask = self.model.training_opts["replicate_input_mask"]
        model_inputs = batch["feed"] + batch["masks"] if self.use_mask else batch["feed"]
        model_targets = batch["targets"] + batch["masks"] if targets_use_mask else batch["targets"]
        return model_inputs, model_targets
 </s> add         if self.use_mask:
            batch = [[batch["feed"], batch["masks"]], batch["targets"] + [batch["masks"]]]
        else:
            batch = [batch["feed"], batch["targets"]]
        self.generate_preview(do_preview)
        return batch </s> remove     def train_one_batch(self):
 </s> add     def train_one_batch(self, do_preview): </s> remove         model_inputs, model_targets = self.get_next()
 </s> add         batch = self.get_next(do_preview) </s> remove             loss = self.model.predictors[self.side].train_on_batch(x=model_inputs, y=model_targets)
 </s> add             loss = self.model.predictors[self.side].train_on_batch(*batch)
    def get_next(self, do_preview):
              raise FaceswapError(msg) from err
          loss = loss if isinstance(loss, list) else [loss]
          return loss
  
    def get_next(self, do_preview):
          """ Return the next batch from the generator
              Items should come out as: (sample, warped, targets, [mask]) """
          logger.debug("Generating targets")
          batch = next(self.feed)
          targets_use_mask = self.model.training_opts["replicate_input_mask"]
keep keep keep keep replace keep keep keep keep keep
 Serialize masks to alignments file

- Add new serializers (npy + compressed)
- Remove Serializer option from cli
- Revert get_aligned call in scripts/extract
- Default alignments to compressed
- Size masks to 128px and compress
- Remove mask thresholding/blur from generation code
- Add Mask class to lib/faces_detect
- Revert debug landmarks to aligned face
- Revert non-extraction code to staging version 
plugins/train/trainer/_base.py