lib.sedna.core.multi_edge_inference.components

Submodules

Package Contents

Classes

BaseService

Base MultiEdgeInference wrapper for video analytics, feature extraction,

FileOperations

Class containing file operations to read/write from disk.

Attributes

POLL_INTERVAL

lib.sedna.core.multi_edge_inference.components.POLL_INTERVAL = 0.01[source]
class lib.sedna.core.multi_edge_inference.components.BaseService(consumer_topics=[], producer_topics=[], plugins: List[sedna.core.multi_edge_inference.plugins.PluggableNetworkService] = [], models: List[sedna.core.multi_edge_inference.plugins.PluggableModel] = [], timeout=10, asynchronous=False)[source]

Bases: abc.ABC

Base MultiEdgeInference wrapper for video analytics, feature extraction, and reid components.

put(data)[source]

Call this function to push data into the component. For example, after you extract a frame from video stream, you can call put(image). Depending on the value of the ‘asynchronous’ parameter, the data will be put into a different data structure.

fetch_data()[source]
get_plugin(plugin_key: sedna.core.multi_edge_inference.plugins.PLUGIN)[source]

This function allows to select the network service to communicate to based on the name (given that is has been registered before). List of registered plugins can be found in plugins/registered.py.

flatten(S)[source]
distribute_data(data=[], **kwargs)[source]

This function sends the data to all the AI models passed to with this component during the initialization phase.

abstract process_data(ai, data, **kwargs)[source]

The user needs to implement this function to call the main processing function of the AI model and decide what to do with the result.

abstract update_operational_mode(status)[source]

The user needs to trigger updates to the AI model, if necessary.

preprocess(data, **kwargs)[source]

The user can override this function to inject some preprocessing operation to be executed before the data is added to the data structure by the ‘put()’ function.

class lib.sedna.core.multi_edge_inference.components.FileOperations[source]

Class containing file operations to read/write from disk.

read_from_disk(path)[source]
delete_from_disk(filename)[source]
write_to_disk(data, folder, exts='.dat')[source]
get_files_list(folder)[source]