vis4d.data.transforms.select_sensor

Select Sensor transformation.

Classes

SelectSensor(*[, in_keys, out_keys, ...])

Keep data from one sensor only but keep shared data.

class SelectSensor(*, in_keys=['data'], out_keys=['data'], sensors=None, same_on_batch=True, **kwargs)[source]

Keep data from one sensor only but keep shared data.

Note: The input data is assumed to be in the format of DictData[DictData], i.e. a list of data dictionaries, each of which contains a dictionary of either the data from a sensor or the shared data (metadata) for all sensors.

Example

>>> data = [
        {
            "sensor1": {"image": 1, "label": 2},
            "sensor2": {"image": 1, "label": 2},
            "meta": 3},
        },
    ]
>>> tsfm = SelectSensor(
        sensor="sensor1", sensors=["sensor1", "sensor2"]
    )
>>> tsfm(data)
[{"image": 1, "label": 2, "meta": 3},]
__call__(batch)[source]

Select data from one sensor only.

Return type:

list[Dict[str, Any]]