                  self._queues["out"].put(item)
                  continue
              for f_idx, face in enumerate(item["detected_faces"]):
                  batch.setdefault("detected_faces", []).append(face)
                  batch.setdefault("filename", []).append(item["filename"])
                  batch.setdefault("image", []).append(item["image"])
                  idx += 1
                  if idx == self.batchsize:
                      frame_faces = len(item["detected_faces"])
 
</s> remove         if (self._detector.vram == 0 and self._aligner.vram == 0 and self._masker.vram == 0
            or get_backend() != "nvidia"):
            logger.debug("Either detector and aligner have no VRAM requirements or not running "
                         "on Nvidia. Not updating batchsize requirements.")
 </s> add         if get_backend() != "nvidia":
            logger.debug("Backend is not Nvidia. Not updating batchsize requirements")
            return
        if self._detector.vram == 0 and self._aligner.vram == 0 and self._masker.vram == 0:
            logger.debug("Either detector, aligner or masker have no VRAM requirements. Not "
                         "updating batchsize requirements.") </s> remove 
    @staticmethod
    def postprocessing(mask):
        """ Post-processing of Nirkin style segmentation masks """
        # Select_largest_segment
        if pop_small_segments:
            results = cv2.connectedComponentsWithStats(mask,  # pylint: disable=no-member
                                                       4,
                                                       cv2.CV_32S)  # pylint: disable=no-member
            _, labels, stats, _ = results
            segments_ranked_by_area = np.argsort(stats[:, -1])[::-1]
            mask[labels != segments_ranked_by_area[0, 0]] = 0.

        # Smooth contours
        if smooth_contours:
            iters = 2
            kernel = cv2.getStructuringElement(cv2.MORPH_RECT,  # pylint: disable=no-member
                                               (5, 5))
            cv2.morphologyEx(mask, cv2.MORPH_OPEN,  # pylint: disable=no-member
                             kernel, iterations=iters)
            cv2.morphologyEx(mask, cv2.MORPH_CLOSE,  # pylint: disable=no-member
                             kernel, iterations=iters)
            cv2.morphologyEx(mask, cv2.MORPH_CLOSE,  # pylint: disable=no-member
                             kernel, iterations=iters)
            cv2.morphologyEx(mask, cv2.MORPH_OPEN,  # pylint: disable=no-member
                             kernel, iterations=iters)

        # Fill holes
        if fill_holes:
            not_holes = mask.copy()
            not_holes = np.pad(not_holes, ((2, 2), (2, 2), (0, 0)), 'constant')
            cv2.floodFill(not_holes, None, (0, 0), 255)  # pylint: disable=no-member
            holes = cv2.bitwise_not(not_holes)[2:-2, 2:-2]  # pylint: disable=no-member
            mask = cv2.bitwise_or(mask, holes)  # pylint: disable=no-member
            mask = np.expand_dims(mask, axis=-1)
        return mask
 </s> add  </s> remove         """ Just return the aligner's predict function """
 </s> add         """ Just return the masker's predict function """
                face.load_feed_face(face.image,
                                    size=self.input_size,
                                    coverage_ratio=1.0,
                                    dtype="float32")
                  self._queues["out"].put(item)
                  continue
              for f_idx, face in enumerate(item["detected_faces"]):
                face.load_feed_face(face.image,
                                    size=self.input_size,
                                    coverage_ratio=1.0,
                                    dtype="float32")
                  batch.setdefault("detected_faces", []).append(face)
                  batch.setdefault("filename", []).append(item["filename"])
                  batch.setdefault("image", []).append(item["image"])
                  idx += 1
                  if idx == self.batchsize:
                      frame_faces = len(item["detected_faces"])
keep keep add keep 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/_base.py