              self.samples = None
              self.target = None
              return
          logger.debug("Generating preview")
          batch = next(self.preview_feed)
          self.samples = batch["samples"]
          self.target = [batch["targets"][self.model.largest_face_index]]
          if self.use_mask:
 
</s> remove             self.masks = None
 </s> add  </s> remove         self.target = batch["targets"][self.model.largest_face_index]
        self.masks = batch["masks"][0]
 </s> add         self.target = [batch["targets"][self.model.largest_face_index]]
        if self.use_mask:
            self.target += [batch["masks"]] </s> remove         self.masks = None
 </s> add         self.mask = None </s> remove         masks = masks if masks is not None else self.masks
        samples = samples if samples is not None else self.samples
        retval = [samples[0:num_images], images[0:num_images], masks[0:num_images]]
 </s> add         retval = [samples[0:num_images]] if samples is not None else [self.samples[0:num_images]]
        if self.use_mask:
            retval.extend(tgt[0:num_images] for tgt in images)
        else:
            retval.extend(images[0:num_images]) </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
        if self.preview_feed is None:
            self.set_preview_feed()
              self.samples = None
              self.target = None
              return
          logger.debug("Generating preview")
        if self.preview_feed is None:
            self.set_preview_feed()
          batch = next(self.preview_feed)
          self.samples = batch["samples"]
          self.target = [batch["targets"][self.model.largest_face_index]]
          if self.use_mask:
keep keep keep add 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