          for new_face, detected_face in zip(predicted["swapped_faces"],
                                             predicted["detected_faces"]):
              predicted_mask = new_face[:, :, -1] if new_face.shape[2] == 4 else None
              new_face = new_face[:, :, :3]
              src_face = detected_face.reference_face / np.array(255.0, dtype="float32")
              interpolator = detected_face.reference_interpolators[1]
  
              new_face = self.pre_warp_adjustments(src_face, new_face, detected_face, predicted_mask)
  
              # Warp face with the mask
 
</s> remove         targets = [batch[..., :3] for batch in size_list_of_batches]
        if size_list_of_batches[-1].shape[-1] == 4:
            masks = [size_list_of_batches[-1][..., 3:]]
 </s> add         batch = [tgt.astype("float32") / 255.0 for tgt in batch]
        if all(tgt.shape[-1] == 4 for tgt in batch):
            logger.trace("Batch contains mask")
            sizes = [item.shape[1] for item in batch]
            mask_batch = np.expand_dims(batch[sizes.index(max(sizes))][..., -1], axis=-1)
            batch = [item[..., :3] for item in batch]
            logger.trace("batch shapes: %s, mask_batch shape: %s",
                         [tgt.shape for tgt in batch], mask_batch.shape)
            retval = dict(targets=batch, masks=mask_batch) </s> remove         # Random Warp # TODO change masks to have a input mask and a warped target mask
        processed["feed"] = [self._processing.warp(batch[..., :3],
                                                   self._training_opts["warp_to_landmarks"],
                                                   **warp_kwargs)]
 </s> add         # Random Warp
        if to_landmarks:
            warp_kwargs = dict(batch_src_points=batch_src_pts,
                               batch_dst_points=self._get_closest_match(filenames,
                                                                        side,
                                                                        batch_src_pts))
        else:
            warp_kwargs = dict()
        processed["feed"] = self._processing.warp(batch[..., :3], to_landmarks, **warp_kwargs) </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         final_faces = list()
        for detected_face in faces["detected_faces"]:
            filename = self.output_dir / Path(detected_face.filename).stem
            final_faces.append({"file_location": filename,
                                "face": detected_face})
        faces["detected_faces"] = final_faces
 </s> add         self.align_face(faces, size, filename)
            src_face = detected_face.reference_face
          for new_face, detected_face in zip(predicted["swapped_faces"],
                                             predicted["detected_faces"]):
              predicted_mask = new_face[:, :, -1] if new_face.shape[2] == 4 else None
              new_face = new_face[:, :, :3]
            src_face = detected_face.reference_face
              interpolator = detected_face.reference_interpolators[1]
  
              new_face = self.pre_warp_adjustments(src_face, new_face, detected_face, predicted_mask)
  
              # Warp face with the 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 
lib/convert.py