vis4d.engine.connectors.multi_sensor

Data connector for multi-sensor dataset.

Functions

get_multi_sensor_inputs(connection_dict, ...)

Extracts multi-sensor input data from the provided SourceKeyDescription.

Classes

MultiSensorCallbackConnector(key_mapping)

Multi-sensor data connector for the callback.

MultiSensorDataConnector(key_mapping)

Data connector for multi-sensor data dict.

MultiSensorLossConnector(key_mapping)

Multi-sensor Data connector for loss module of the training pipeline.

class MultiSensorCallbackConnector(key_mapping)[source]

Multi-sensor data connector for the callback.

Initializes the data connector with static remapping of the keys.

__call__(prediction, data)[source]

Returns the kwargs that are passed to the callback.

Parameters:
  • prediction (DictData | NamedTuple) – The output from model.

  • data (DictData) – The data dictionary from the dataloader which contains all data that was loaded.

Returns:

kwargs that are passed onto the callback.

Return type:

DictData

class MultiSensorDataConnector(key_mapping)[source]

Data connector for multi-sensor data dict.

Initializes the data connector with static remapping of the keys.

Parameters:

key_mapping (dict[str, | SourceKeyDescription]) – Defines which kwargs to pass onto the module.

TODO: Add Simple Example Configuration:

__call__(data)[source]

Returns the train input for the model.

Return type:

Dict[str, Any]

class MultiSensorLossConnector(key_mapping)[source]

Multi-sensor Data connector for loss module of the training pipeline.

Initializes the data connector with static remapping of the keys.

__call__(prediction, data)[source]

Returns the kwargs that are passed to the loss module.

Parameters:
  • prediction (DictData | NamedTuple) – The output from model.

  • data (DictData) – The data dictionary from the dataloader which contains all data that was loaded.

Returns:

kwargs that are passed onto the loss.

Return type:

DictData

get_multi_sensor_inputs(connection_dict, prediction, data)[source]

Extracts multi-sensor input data from the provided SourceKeyDescription.

Parameters:
  • connection_dict (dict[str, SourceKeyDescription]) – Input Key description which is used to gather and remap data from the two data dicts.

  • prediction (DictData) – Dict containing the model prediction output.

  • data (DictData) – Dict containing the dataloader output.

Raises:

ValueError – If the datasource is invalid.

Returns:

Dict containing new kwargs consisting of new key name

and data extracted from the data dicts.

Return type:

out (DictData)