The implementation of the TensorBay frame.

class tensorbay.dataset.frame.Frame(frame_id=None)[source]

Bases: tensorbay.utility.user.UserMutableMapping[str, DataBase._Type]

This class defines the concept of frame.

Frame is a concept in FusionDataset.

It is the structure that composes FusionSegment, and consists of multiple Data collected at the same time corresponding to different sensors.

Since Frame extends UserMutableMapping, its basic operations are the same as a dictionary’s.

To initialize a Frame and add a Data to it:

frame = Frame()
frame[sensor_name] = Data()
classmethod from_response_body(body, url_index, urls, *, cache_path='')[source]

Loads a Frame object from a response body.

  • body (Dict[str, Any]) –

    The response body which contains the information of a frame, whose format should be like:

        "frameId": <str>,
        "frame": [
                "sensorName": <str>,
                "remotePath": <str>,
                "timestamp": <float>,
                "url": <str>,
                "label": {...}

  • url_index (int) – The index of the url.

  • urls (tensorbay.client.lazy.LazyPage[Dict[str, str]]) – A sequence of mappings which key is the sensor name and value is the url.

  • cache_path (str) – The path to store the cache.


The loaded Frame object.

Return type