"The CAN bus is a vehicle bus over which information such as position, velocity, acceleration, steering, lights, battery and many more are submitted. We recommend you start by reading the [README](https://github.com/nutonomy/nuscenes-devkit/tree/master/python-sdk/nuscenes/can_bus/README.md)\n",
"In [data_converter](https://github.com/zhiqi-li/BEVFormer/blob/master/tools/data_converter/nuscenes_converter.py), we use the following function to obatain the can bus information for each sample."
" # the last two numbers are reserved for later calculation of rotation angle.\n",
" can_bus.extend([0., 0.])\n",
" \n",
" \n",
" return np.array(can_bus)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In [dataset](https://github.com/zhiqi-li/BEVFormer/blob/master/projects/mmdet3d_plugin/datasets/nuscenes_dataset.py#L174), we reorganize the can_bus."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
" # actually, the nuScenes provides the rotation and translation of each sample, which is more accurate than we obtained from can bus. \n",
" can_bus[:3] = translation # We use the provided translation and rotation to repalce the original translation and rotation in can bus\n",
" can_bus[3:7] = rotation\n",
" \n",
" patch_angle = quaternion_yaw(rotation) / np.pi * 180 # we get the yaw angle of ego car\n",
" can_bus[-2] = patch_angle / 180 * np.pi # this angle is kept unchanged.\n",
" can_bus[-1] = patch_angle # this angle is used to compute the detal of adjacent timestamps."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In [dataset](https://github.com/zhiqi-li/BEVFormer/blob/master/projects/mmdet3d_plugin/datasets/nuscenes_dataset.py#L93), we compute the delta orientation and position of adjacent timestamps"
Note: using 1 GPU to eval can obtain slightly higher performance because continuous video may be truncated with multiple GPUs. By default we report the score evaled with 8 GPUs.
# Using FP16 to train the model.
The above training script can not support FP16 training,
and we provide another script to train BEVFormer with FP16.