Skip to article frontmatterSkip to article content

7Stream types in Faery

Faery supports streams of various data types with different characteristics. Understanding these streams is crucial for understanding the behavior of Faery---and in particular the Python API.

7.1Stream types

All streams are implemented as a Stream which iterates over some data. The data type characterizes what is contained in the stream. We mostly operate with two types: events and frames:

StreamData TypeCharacteristics
EventsStreamnp.ndarraySparse event data represented as timestamps, 2-d coordinates, and polarity bit (t, x, y, p).
FrameStreamFrameDense frame data represented as [timestamp, np.ndarray](python/faery/frame_stream.py).

7.2Finite, infinite, and regular streams

Apart from the type of data, streams can have different characteristics that matter a great deal for what you can do with them. For instance, a finite stream can be processed in a single pass, while an infinite stream requires some kind of continuous processing. Additionally, streams can be structured in time by sending data at regular intervals.

Stream typeDescriptionExamples
InfiniteStreamAn infinite stream requires some kind of continuous processing.Reading from a camera or UDP source.
FiniteStreamA finite stream can be processed in a single pass.Reading from a file or a finite source.
RegularStreamA regular stream sends data at regular intervals.Filtering an event stream to output events at regular intervals.
FiniteRegularStreamA finite regular stream sends data at regular intervals and can be processed in a single pass.Filtering a finite event stream to output events at regular intervals.