tensorbay.dataset.frame¶
Frame.
Frame
is a concept in FusionDataset
.
It is the structure that composes a FusionSegment
,
and consists of multiple Data
collected at the same time
from different sensors.
- class tensorbay.dataset.frame.Frame(frame_id: Optional[ulid.ulid.ULID] = 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 multipleData
collected at the same time corresponding to different sensors.Since
Frame
extendsUserMutableMapping
, 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: Dict[str, Any], frame_index: int, urls: Sequence[Mapping[str, str]]) tensorbay.dataset.frame._T [source]¶
Loads a
Frame
object from a response body.- Parameters
body –
The response body which contains the information of a frame, whose format should be like:
{ "frameId": <str>, "frame": [ { "sensorName": <str>, "remotePath": <str>, "timestamp": <float>, "label": {...} }, ... ... ] }
frame_index – The index of the frame.
urls – A sequence of mappings which key is the sensor name and value is the url.
- Returns
The loaded
Frame
object.