Dataset Assistance Tool

To facilitate your use, we also provide some dataset auxiliary tools. The following will introduce them to you based on the usage scenarios.

Extract Camera Parameters

Usage

Run tools/gen_camera_param_nusc.py to retrieve the intrinsic and extrinsic parameters of cameras from the nuScenes dataset.

Parameters Introduction

ParameterDescription
--data-pathThe root directory path of the nuScenes dataset.
--save-pathPath to save the output.
--save-by-cityWhether to save by city.
--versionDataset version.

Usgae Example

Save the intrinsic and extrinsic parameter matrices of NuScenes cameras by city.

python3 tools/gen_camera_param_nusc.py --data-path /path/to/nuscenes --save-path ./camera_params_city --save-by-city --version v1.0-trainval

Extract Model Input Reference Points

Usage

Run tools/gen_reference_points_nusc.py to obtain the model input reference points from the nuScenes dataset.

Parameters Introduction

ParameterDescription
--data-pathRoot directory of the dataset.
--save-pathPath to save the output.
--save-by-cityWhether to save by city.
--versionDataset version.
--config CONFIG, -c CONFIGPath to the config file.

Usgae Example

python3 tools/gen_reference_points_nusc.py \
        --data-path /path/to/nuscenes \
        --save-path ./output/ref_points_city \
        --save-by-city True \
        --version v1.0-trainval \
        -c configs/bev/bevformer_tiny_resnet50_detection_nuscenes.py

Compute Transformation Matrix

Usage

Run tools/homography_generator.py to calculate the transformation matrix from ego to image.

Parameters Introduction

ParameterDescription
--sensor2ego-translationTranslation matrix from sensor to ego coordinate system.
--sensor2ego-rotationRotation matrix from sensor to ego coordinate system.
--camera-intrinsicCamera intrinsic and extrinsic matrix.
--save-pathPath to save the output.

Usgae Example

python3 tools/homography_generator.py \
    --sensor2ego-translation ./data/s2e_translation.npy \
    --sensor2ego-rotation ./data/s2e_rotation.npy \
    --camera-intrinsic ./data/camera_intrinsic.npy \
    --save-path ./output/homography

Compute Model Input Reference Points

Usage

Run tools/reference_points_generator.py to calculate the model input reference points from the homography matrix.

Parameters Introduction

ParameterDescription
--config CONFIG, -c CONFIGPath to the config file.
--homographyPath to the transformation matrix.
--save-pathPath to save the output.

Usgae Example

python3 tools/reference_points_generator.py \
        --config ./configs/bev/bevformer_tiny_resnet50_detection_nuscenes.py \
        --homography ./output/homography.npy \
        --save-path ./output/reference_points

For a detailed introduction to the configuration file, please refer to the [Configuration] section [config configuration] (../config/keywords).