InputIterator

class lib.infer.iterator.InputIterator(queue: Queue[QueueItemInT | ExtractSignal], name: str, plugin_type: T.Literal['detect', 'align', 'mask', 'identity', 'file'], batch_size: int, error_state: ErrorState)

Bases: ExtractIterator[FrameFaces, ExtractBatch]

An iterator that processes FrameFaces data that is input to a plugin pipeline to create ExtractBatch objects at the correct batch size for processing through the pipeline’s first plugin

Parameters:
  • queue (Queue[QueueItemInT | ExtractSignal]) – The inbound queue to the plugin pipeline

  • name (str) – The plugin name and process calling this iterator

  • plugin_type (T.Literal['detect', 'align', 'mask', 'identity', 'file']) – The type of extractor plugin that this iterator is serving

  • batch_size (int) – The batch size that data should be returned from the iterator

  • error_state (ErrorState)

__next__() ExtractBatch | ExtractSignal

Get the next batch of data from the iterator. Depending on the plugin type calling this iterator, a batch object will be returned for the given batch size of frames (for detect plugins) or faces (for all other plugins)

Returns:

A new Batch object containing the batch to process through the plugin or a signal

Return type:

ExtractBatch or ExtractSignal

Raises:

StopIteration – When the input is exhausted