tianweiy / CenterPoint

MIT License
1.88k stars 456 forks source link

question about the point cloud range #84

Closed nuoloveheng closed 3 years ago

nuoloveheng commented 3 years ago

hello, Thanks for your work. I have a question about the point cloud range. we have done a lot of training with the original pointpillar, if I use point cloud range(pc range)==(-74.88, -74.88, -2, 74.88, 74.88, 4.0) train the network, when we predict, we actually can expand the range to (-108.88, -74.88, -2, 108.88, 74.88, 4.0), The result remains same but it can cover more range. But for centerNet, when we train network with (-74.88, -74.88, -2, 74.88, 74.88, 4.0) and predict it with pc = (-108.88, -74.88, -2, 108.88, 74.88, 4.0), it shows wrong result completely. Because of the heat map? do you know the theory behind this?

tianweiy commented 3 years ago

Please attach your modified config.

nuoloveheng commented 3 years ago

thank you for your reply tasks = [ dict(num_class=3, class_names=['VEHICLE', 'PEDESTRIAN', 'CYCLIST']), ]

class_names = list(itertools.chain(*[t["class_names"] for t in tasks]))

training and testing settings

target_assigner = dict( tasks=tasks, )

model settings

model = dict( type="PointPillars", pretrained=None, reader=dict( type="PillarFeatureNet", num_filters=[64, 64], num_input_features=5, with_distance=False, voxel_size=(0.32, 0.32, 6.0), pc_range=(-108.88, -32.88, -2, 108.88, 32.88, 4.0),#pc_range=(-108.88, -32.88, -2, 108.88, 32.88, 4.0) ), backbone=dict(type="PointPillarsScatter", ds_factor=1), neck=dict( type="RPN", layer_nums=[3, 5, 5], ds_layer_strides=[1, 2, 2], ds_num_filters=[64, 128, 256], us_layer_strides=[1, 2, 4], us_num_filters=[128, 128, 128], num_input_features=64, logger=logging.getLogger("RPN"), ), bbox_head=dict( type="CenterHead", in_channels=128*3, tasks=tasks, dataset='waymo', weight=2, code_weights=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], common_heads={'reg': (2, 2), 'height': (1, 2), 'dim':(3, 2), 'rot':(2, 2)}, # (output_channel, num_conv) ), )

assigner = dict( target_assigner=target_assigner, out_size_factor=get_downsample_factor(model), dense_reg=1, gaussian_overlap=0.1, max_objs=500, min_radius=2, )

train_cfg = dict(assigner=assigner)

test_cfg = dict( post_center_limit_range=[-80, -80, -10.0, 80, 80, 10.0], nms=dict( nms_pre_max_size=4096, nms_post_max_size=500, nms_iou_threshold=0.7, ), score_threshold=0.1, pc_range=[-74.88, -74.88], out_size_factor=get_downsample_factor(model), voxel_size=[0.32, 0.32] )

dataset settings

dataset_type = "WaymoDataset" nsweeps = 1 data_root = "data/Waymo"

db_sampler = dict( type="GT-AUG", enable=False, db_info_path="data/Waymo/dbinfos_train_1sweeps_withvelo.pkl", sample_groups=[ dict(VEHICLE=15), dict(PEDESTRIAN=10), dict(CYCLIST=10), ], db_prep_steps=[ dict( filter_by_min_num_points=dict( VEHICLE=5, PEDESTRIAN=5, CYCLIST=5, ) ), dict(filter_by_difficulty=[-1],), ], global_random_rotation_range_per_object=[0, 0], rate=1.0, )

train_preprocessor = dict( mode="train", shuffle_points=True, global_rot_noise=[-0.78539816, 0.78539816], global_scale_noise=[0.95, 1.05], db_sampler=db_sampler, class_names=class_names, )

val_preprocessor = dict( mode="val", shuffle_points=False, )

voxel_generator = dict( range=[-74.88, -74.88, -2, 74.88, 74.88, 4.0], voxel_size=[0.32, 0.32, 6.0], max_points_in_voxel=20, max_voxel_num= [32000, 60000] # we only use non-empty voxels. this will be much smaller than max_voxel_num )

train_pipeline = [ dict(type="LoadPointCloudFromFile", dataset=dataset_type), dict(type="LoadPointCloudAnnotations", with_bbox=True), dict(type="Preprocess", cfg=train_preprocessor), dict(type="Voxelization", cfg=voxel_generator), dict(type="AssignLabel", cfg=train_cfg["assigner"]), dict(type="Reformat"), ] test_pipeline = [ dict(type="LoadPointCloudFromFile", dataset=dataset_type), dict(type="LoadPointCloudAnnotations", with_bbox=True), dict(type="Preprocess", cfg=val_preprocessor), dict(type="Voxelization", cfg=voxel_generator), dict(type="AssignLabel", cfg=train_cfg["assigner"]), dict(type="Reformat"), ]

tianweiy commented 3 years ago

you also need to change

test_cfg = dict(
post_center_limit_range=[-80, -80, -10.0, 80, 80, 10.0],
nms=dict(
nms_pre_max_size=4096,
nms_post_max_size=500,
nms_iou_threshold=0.7,
),
score_threshold=0.1,
pc_range=[-74.88, -74.88],
out_size_factor=get_downsample_factor(model),
voxel_size=[0.32, 0.32]
)

and

voxel_generator = dict(
range=[-74.88, -74.88, -2, 74.88, 74.88, 4.0],
voxel_size=[0.32, 0.32, 6.0],
max_points_in_voxel=20,
max_voxel_num= [32000, 60000] # we only use non-empty voxels. this will be much smaller than max_voxel_num
)

to match your new point cloud range

nuoloveheng commented 3 years ago

Thank you for your reply, I have another question test_cfg = dict( post_center_limit_range=[-80, -80, -10.0, 80, 80, 10.0], nms=dict( nms_pre_max_size=4096, nms_post_max_size=500, nms_iou_threshold=0.7, ), score_threshold=0.1, pc_range=[-74.88, -74.88], out_size_factor=get_downsample_factor(model), voxel_size=[0.32, 0.32] ) here pc_range has only 2 parameters, does it mean that the size of x, y must be the same?

tianweiy commented 3 years ago

no, here it is the pc_range for x_left and y_left

hughlee815 commented 3 years ago

Thanks.