      def finalize(self, batch):
          """ **Override method** (at `<plugin_type>` level)
  
          This method should be overridden at the `<plugin_type>` level (IE.
          :mod:`plugins.extract.detect._base` or :mod:`plugins.extract.align._base`) and should not
          be overridden within plugins themselves.
  
          Handles consistent finalization for all plugins that exist within that plugin type. Its
          input is always the output from :func:`process_output()`
  
          Parameters
 
</s> remove         :mod:`plugins.extract.detect._base` or :mod:`plugins.extract.align._base`) and should not
        be overridden within plugins themselves.
 </s> add         :mod:`plugins.extract.detect._base`, :mod:`plugins.extract.align._base` or
        :mod:`plugins.extract.mask._base`) and should not be overridden within plugins themselves. </s> remove         Get items from the queue in batches of :attr:`batchsize`
 </s> add         Get :class:`~plugins.extract.pipeline.ExtractMedia` items from the queue in batches of
        :attr:`batchsize` </s> remove         for face in faces["detected_faces"]:
            face.load_aligned(faces["image"], size=size)
 </s> add         for face in extract_media.detected_faces:
            face.load_aligned(extract_media.image, size=size) </s> remove         faces: dict
            Dictionary output from :class:`plugins.extract.Pipeline.Extractor`
 </s> add         extract_media: :class:`plugins.extract.pipeline.ExtractMedia`
            Output from :class:`plugins.extract.pipeline.Extractor` </s> remove         The input queue is the entry point into the extraction pipeline. A ``dict`` should
        be put to the queue in the following format(s):

        For detect/single phase operations:

        >>> {'filename': <path to the source image that is to be extracted from>,
        >>>  'image': <the source image as a numpy.ndarray in BGR color format>}

        For align (2nd pass operations):
 </s> add         The input queue is the entry point into the extraction pipeline. An :class:`ExtractMedia`
        object should be put to the queue.
        :mod:`plugins.extract.detect._base`, :mod:`plugins.extract.align._base` or
        :mod:`plugins.extract.mask._base`) and should not be overridden within plugins themselves.
      def finalize(self, batch):
          """ **Override method** (at `<plugin_type>` level)
  
          This method should be overridden at the `<plugin_type>` level (IE.
        :mod:`plugins.extract.detect._base`, :mod:`plugins.extract.align._base` or
        :mod:`plugins.extract.mask._base`) and should not be overridden within plugins themselves.
        :mod:`plugins.extract.detect._base`, :mod:`plugins.extract.align._base` or
        :mod:`plugins.extract.mask._base`) and should not be overridden within plugins themselves.
  
          Handles consistent finalization for all plugins that exist within that plugin type. Its
          input is always the output from :func:`process_output()`
  
          Parameters
keep keep keep keep replace replace keep keep keep keep keep
 plugins.extract - Create ExtractMedia class for pipeline flow
Bugfix - Fix memory leak in extract 
plugins/extract/_base.py