          else:
              logger.trace("item: %s, queue: %s", item, queue)
          return item
  
      # <<< MISC UTILITY METHODS >>> #
      def _convert_color(self, image):
          """ Convert the image to the correct color format and strip alpha channel """
          logger.trace("Converting image to color format: %s", self.colorformat)
          if self.colorformat == "RGB":
              cvt_image = image[..., 2::-1].copy()
          elif self.colorformat == "GRAY":
              cvt_image = cv2.cvtColor(image.copy(), cv2.COLOR_BGR2GRAY)
          else:
              cvt_image = image[..., :3].copy()
          return cvt_image
  
      @staticmethod
      def _dict_lists_to_list_dicts(dictionary):
          """ Convert a dictionary of lists to a list of dictionaries """
          return [dict(zip(dictionary, val)) for val in zip(*dictionary.values())]
  
 
</s> remove 
    @staticmethod
    def _remove_invalid_keys(dictionary, valid_keys):
        """ Remove items from dict that are no longer required """
        for key in list(dictionary.keys()):
            if key not in valid_keys:
                logger.trace("Removing from output: '%s'", key)
                del dictionary[key]
 </s> add  </s> remove         if isinstance(item, dict):
            logger.trace("item: %s, queue: %s",
                         {k: v.shape if isinstance(v, np.ndarray) else v
                          for k, v in item.items()},
                         queue)
 </s> add         if isinstance(item, ExtractMedia):
            logger.trace("filename: '%s', image shape: %s, detected_faces: %s, queue: %s, "
                         "item: %s",
                         item.filename, item.image_shape, item.detected_faces, queue, item)
            self._extract_media[item.filename] = item </s> remove     @staticmethod
    def _get_item(queue):
 </s> add     def _get_item(self, queue): </s> remove                              item["filename"], len(item["detected_faces"]))
                self._faces_per_filename[item["filename"]] = len(item["detected_faces"])
 </s> add                              item.filename, len(item.detected_faces))
                self._faces_per_filename[item.filename] = len(item.detected_faces) </s> remove         >>> {'filename': <path to the source image that is to be extracted from>,
        >>>  'image': <the source image as a numpy.ndarray in BGR color format>,
        >>>  'detected_faces: [<list of DetectedFace objects as generated from detect>]}
 </s> add         For detect/single phase operations the :attr:`ExtractMedia.filename` and
        :attr:`~ExtractMedia.image` attributes should be populated.
          else:
              logger.trace("item: %s, queue: %s", item, queue)
          return item
  












      @staticmethod
      def _dict_lists_to_list_dicts(dictionary):
          """ Convert a dictionary of lists to a list of dictionaries """
          return [dict(zip(dictionary, val)) for val in zip(*dictionary.values())]
  
keep keep keep keep replace replace replace replace replace replace replace replace replace replace 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