thu-ml / 3D_Corruptions_AD

Benchmarking Robustness of 3D Object Detection to Common Corruptions in Autonomous Driving, CVPR 2023
MIT License
120 stars 15 forks source link

The function arguments in bbox_util.py #6

Open caimumuxin opened 1 year ago

caimumuxin commented 1 year ago

There are some codes in bbox_util.py: MAP = { 'density_dec_bbox':density, 'cutout_bbox':cutout, 'gaussian_noise_bbox':gaussian, 'uniform_noise_bbox':uniform, 'impulse_noise_bbox':impulse, 'scale_bbox':scale, 'shear_bbox':shear, 'rotation_bbox':rotation, 'moving_noise_bbox':moving_object, } and if 'bbox' in cor: pcd_2 = MAP[cor](pcd_2, slevel, gt_boxes) else: pcd_2 = MAP[cor](pcd_2, slevel)

while in the 9 functions defined in this file, { def density(pointcloud, severity): def cutout(pointcloud, severity): def gaussian(pointcloud, severity): def uniform(pointcloud, severity): def impulse(pointcloud, severity): def shear(pointcloud, severity,gt_boxes): def scale(pointcloud, severity,gt_boxes): def rotation(pointcloud,severity,gt_boxes): def moving_object(pointcloud, severity): } only three of them need the gt_boxes argument, but all of them have 'bbox' in cor and run pcd_2 = MAP[cor](pcd_2, slevel, gt_boxes). When I run the function gaussian_noise_bbox(), I will get the error: File "d:\code\mmdetection3d-main\mmdet3d\datasets\transforms\utils\bbox_util.py", line 318, in pick_bbox pcd_2 = MAP[cor](pcd_2, slevel, gt_boxes) TypeError: gaussian() takes 2 positional arguments but 3 were given

daixinguang commented 1 year ago

I have the same problem,I changed code as follow:

MAP = {
    'density_dec':density,
    'cutout':cutout,
    'gaussian_noise':gaussian,
    'uniform_noise':uniform,
    'impulse_noise':impulse,
    'scale_bbox':scale, # 需要bbox
    'shear_bbox':shear, # 需要bbox
    'rotation_bbox':rotation, # 需要bbox
    'moving_noise':moving_object,
}

LiDAR_corruptions.py

def gaussian_noise_bbox(pointcloud,severity,bbox):
    # cor = 'gaussian_noise_bbox'
    cor = 'gaussian_noise'

it can be run successful!