d3d.dataset.waymo
- class d3d.dataset.waymo.loader.WaymoLoader(base_path, phase='training', inzip=False, trainval_split=None, trainval_random=False, nframes=0)[source]
Bases:
d3d.dataset.base.TrackingDatasetBase
Load Waymo dataset into a usable format. Please use the d3d_waymo_convert command to convert the dataset first into following formats
Directory Structure:
- <base_path directory> - training - xxxxxxxxxxxxxxxxxxxx_xxx_xxx_xxx_xxx(.zip) - ... - validation - xxxxxxxxxxxxxxxxxxxx_xxx_xxx_xxx_xxx(.zip) - ...
For description of constructor parameters, please refer to
d3d.dataset.base.TrackingDatasetBase
- Parameters
base_path – directory containing the zip files, or the required data
inzip – whether the dataset is store in original zip archives or unzipped
phase – training, validation or testing
trainval_split – the ratio to split training dataset. See documentation of
split_trainval_seq()
for detail.trainval_random – whether select the train/val split randomly. See documentation of
split_trainval_seq()
for detail.nframes –
number of consecutive frames returned from the accessors
If it’s a positive number, then it returns adjacent frames with total number reduced
If it’s a negative number, absolute value of it is consumed
If it’s zero, then it act like object detection dataset, which means the methods will return unpacked data
trainval_byseq – Whether split trainval partitions by sequences instead of frames
- VALID_OBJ_CLASSES
- annotation_3dobject(idx, raw=False)[source]
Return list of converted ground truth targets in lidar frame.
- Parameters
idx – index of requested frame
raw – if false, targets will be converted to d3d
d3d.abstraction.Target3DArray
format, otherwise raw data will be returned in original format.
- calibration_data(idx)[source]
Return the calibration data. Notices that we assume the calibration is fixed among one squence, so it always return a single object.
- Parameters
idx – index of requested lidar frames
raw – If false, converted
d3d.abstraction.TransformSet
will be returned, otherwise raw data will be returned in original format
- dump_detection_output(idx, detections, fout)[source]
- Parameters
detections (d3d.abstraction.Target3DArray) – detection result
ids – auxiliary information for output, each item contains context name and timestamp
fout (io.RawIOBase) – output file-like object
- Return type
None
- identity(idx)[source]
Return something that can track the data back to original dataset
- Parameters
idx – index of requested frame to be parsed
- Returns
if
nframes
> 0, then the function return a list of ids which are consistent with other functions.
- lidar_data(idx, names=None, formatted=False)[source]
If multiple frames are requested, the results will be a list of list. Outer list corresponds to frame names and inner list corresponds to time sequence. So len(names) × len(frames) data objects will be returned
- Parameters
names – name of requested lidar sensors. The default frame is the first element in
VALID_LIDAR_NAMES
.idx – index of requested lidar frames
formatted –
if true, the point cloud wrapped in a numpy record array will be returned
If single index is given, then the frame indexing is done on the whole dataset with trainval split
If a tuple is given, it’s considered to be a unique id of the frame (from
identity()
method), trainval split is ignored in this way and nframes offset is not added
- pose(idx, raw=False)[source]
Return (relative) pose of the vehicle for the frame. The base frame should be ground attached which means the base frame will follow a East-North-Up axis order.
- Parameters
idx – index of requested frame
names – specify the sensor whose pose is requested. This option only make sense when the dataset contains separate timestamps for data from each sensor. In this case, the pose either comes from dataset, or from interpolation.
raw – if false, targets will be converted to d3d
d3d.abstraction.EgoPose
format, otherwise raw data will be returned in original format.
- property pose_name
Return the sensor frame name whose coordinate the pose is reported in. This frame can be different from the default frame in the calibration TransformSet.
- property sequence_ids
Return the list of sequence ids
- property sequence_sizes
Return the mapping from sequence id to sequence sizes
- timestamp(idx)[source]
Return the timestamp of frame specified by the index, represented by Unix timestamp in macroseconds (usually 16 digits integer)
- Parameters
idx – index of requested frame
names – specify the sensor whose pose is requested. This option only make sense when the dataset contains separate timestamps for data from each sensor.
- d3d.dataset.waymo.loader.create_submission(result_path, output_file, exec_path, meta_path, model_name=None)[source]
Execute create_submission from waymo_open_dataset :param exec_path: path to create_submission executable from waymo devkit :param result_path: path (or list of path) to detection result in binary protobuf from dump_detection_output :param meta_path: path to the metadata file (example: waymo_open_dataset/metrics/tools/submission.txtpb) :param output_path: output path for the created submission archive