  
      def predict(self, batch):
          """ Run model to get predictions """
          predictions = self.model.predict(batch["feed"])
          batch["prediction"] = predictions[..., 1:2] * 255.
          return batch
  
      def process_output(self, batch):
          """ Compile found faces for output """
          for idx, (face, predicts) in enumerate(zip(batch["detected_faces"], batch["prediction"])):
 
</s> remove         batch["prediction"] = predictions[..., 0:1] * -255. + 255.
 </s> add         batch["prediction"] = predictions[..., 0] * -1.0 + 1.0 </s> remove         predictions = self.model.predict(batch["feed"])
        batch["prediction"] = predictions * 255.
 </s> add         batch["prediction"] = self.model.predict(batch["feed"]) </s> remove         batch["prediction"] = np.full(batch["feed"].shape[:-1] + (1,),
                                      fill_value=255,
                                      dtype='uint8')
 </s> add         batch["prediction"] = np.ones_like(batch["feed"], dtype="float32") </s> remove         for index, face in enumerate(batch["detected_faces"]):
            face.load_aligned(face.image,
                              size=self.mask_in_size,
                              dtype='float32')
            self.input[index] = face.aligned["face"][..., :3]
        batch["feed"] = self.input / 255.
 </s> add         batch["feed"] = np.array([face.feed_face[..., :3]
                                  for face in batch["detected_faces"]], dtype="float32") / 255.0
        logger.trace("feed shape: %s", batch["feed"].shape) </s> remove         for idx, (face, predicts) in enumerate(zip(batch["detected_faces"], batch["prediction"])):
            generator = (cv2.GaussianBlur(mask, (7, 7), 0) for mask in predicts)
            predicted = np.array(tuple(generator))
            predicted[predicted < 10.] = 0.
            predicted[predicted > 245.] = 255.

            face.load_feed_face(face.image,
                                size=self.input_size,
                                coverage_ratio=self.coverage_ratio)
            feed_face = face.feed["face"][..., :3]
            feed_mask = self._resize(predicted, self.input_size).astype('uint8')
            batch["detected_faces"][idx].feed["face"] = np.concatenate((feed_face,
                                                                        feed_mask),
                                                                       axis=-1)
            face.load_reference_face(face.image,
                                     size=self.output_size,
                                     coverage_ratio=self.coverage_ratio)
            ref_face = face.reference["face"][..., :3]
            ref_mask = self._resize(predicted, self.output_size).astype('uint8')
            batch["detected_faces"][idx].reference["face"] = np.concatenate((ref_face,
                                                                             ref_mask),
                                                                            axis=-1)
 </s> add 
        batch["prediction"] = predictions[..., -1]
  
      def predict(self, batch):
          """ Run model to get predictions """
          predictions = self.model.predict(batch["feed"])
        batch["prediction"] = predictions[..., -1]
          return batch
  
      def process_output(self, batch):
          """ Compile found faces for output """
          for idx, (face, predicts) in enumerate(zip(batch["detected_faces"], batch["prediction"])):
keep keep keep keep replace keep keep keep keep keep
 Mask plugin cleanup

- PEP8 Fixes
- Remove config for non NN Masks
- Tidy up defaults helptext
- cli.py fix typos
- Remove unused imports and functions _base.py
- Standardize input_size param
- Enable and update documentation
- Change references from `aligner` to `masker`
- Change  input_size, output_size and coverage_ratio from kwargs to params
- Move load_aligned to batch input iterator
- Remove unnecessary self.input param
- Add softmax layer append function to KSession
- Remove references to KSession protected objects
- Standardize plugin output into finalize method
- Make masks full frame and add to lib.faces_detect
- Add masks to alignments.json (temporary zipped base64 solution) 
plugins/extract/mask/vgg_clear.py