DynAIkonTrap.filtering.remember_from_disk#

This module interfaces saved events on the disk to the remainder of the event filtering pipeline. It is intended that event directories are read in as a queue from CameraToDisk and loaded into memory in turn by EventRememberer.

Events are loaded with into instances of EventData.

The output is accessible via a queue.

Classes

EventData(raw_raster_file_indices, dir, ...)

A class for storing motion event data for further processing.

EventRememberer(read_from)

This object reads new event directories from an instance of CameraToDisk.

EventSynthesisor(read_from, video_path)

This object reads events from a VideoStream and creates synthetic EventData packages.

class EventData(raw_raster_file_indices: ~typing.List[int] = <factory>, dir: str = '', start_timestamp: float = 0.0, dims: ~typing.Tuple[int, int] = (0, 0))#

A class for storing motion event data for further processing.

dims: Tuple[int, int] = (0, 0)#
dir: str = ''#
raw_raster_file_indices: List[int]#
start_timestamp: float = 0.0#
class EventRememberer(read_from: Union[CameraToDisk, EventSynthesisor])#

This object reads new event directories from an instance of CameraToDisk. Outputs a Queue of EventData objects for further processing.

Initialises EventRememberer. Starts events processing thread.

Parameters:

read_from (CameraToDisk) – The CameraToDisk object creating event directories on disk.

dir_to_event(dir: str) EventData#

converts an event directory to an instance of EventData

Parameters:

dir (str) – event directory

Returns:

populated instance of event data.

Return type:

EventData

get() EventData#

Get next EventData object in the output queue

Returns:

Next EventData object

Return type:

EventData

proc_events()#

Process input queue of event directories

class EventSynthesisor(read_from: VideoStream, video_path: str)#

This object reads events from a VideoStream and creates synthetic EventData packages. Produces event directories upon calling of the contained get() method.

Initialise an event Sythesisor from a Vid2Frames.VideoStream.

Parameters:
  • read_from (VideoStream) – The VideoStream to read each frame from. This is used to capture the raw image frames in YUV format

  • video_path (str) – The video file from which the VideoStream is generated from. Used to copy an encoded video to the event directory

get() str#

Produces an event directory from the given VideoStream used for initialisation.

YUV format image frames are interpreted and read from each image frame and saved to clip.dat

An encoded video file is copied to the output directory and named clip.mp4

Returns:

Directory for the synthesised event, containing clip.mp4 and clip.dat

Return type:

str