From 7c601b069e6e3730cd839fd063f18ba102033bc3 Mon Sep 17 00:00:00 2001 From: ChaimZhu Date: Mon, 10 Jan 2022 19:08:45 +0800 Subject: [PATCH 1/9] upgrade PointPillars performace on dev branch --- .../models/hv_pointpillars_secfpn_kitti.py | 14 +++++++------ ...pillars_secfpn_6x8_160e_kitti-3d-3class.py | 12 +++-------- mmdet3d/datasets/kitti_dataset.py | 21 ++++++++++++++++++- mmdet3d/datasets/pipelines/dbsampler.py | 11 +++++++++- mmdet3d/datasets/pipelines/transforms_3d.py | 15 +++++++++++-- .../models/voxel_encoders/pillar_encoder.py | 16 +++++++++----- setup.cfg | 2 +- 7 files changed, 66 insertions(+), 25 deletions(-) diff --git a/configs/_base_/models/hv_pointpillars_secfpn_kitti.py b/configs/_base_/models/hv_pointpillars_secfpn_kitti.py index bb2014729f..bd0312516b 100644 --- a/configs/_base_/models/hv_pointpillars_secfpn_kitti.py +++ b/configs/_base_/models/hv_pointpillars_secfpn_kitti.py @@ -14,7 +14,8 @@ feat_channels=[64], with_distance=False, voxel_size=voxel_size, - point_cloud_range=[0, -39.68, -3, 69.12, 39.68, 1]), + point_cloud_range=[0, -39.68, -3, 69.12, 39.68, 1], + legacy=False), middle_encoder=dict( type='PointPillarsScatter', in_channels=64, output_shape=[496, 432]), backbone=dict( @@ -34,12 +35,13 @@ in_channels=384, feat_channels=384, use_direction_classifier=True, + assign_per_class=True, anchor_generator=dict( type='Anchor3DRangeGenerator', ranges=[ - [0, -39.68, -0.6, 70.4, 39.68, -0.6], - [0, -39.68, -0.6, 70.4, 39.68, -0.6], - [0, -39.68, -1.78, 70.4, 39.68, -1.78], + [0.08, -39.60, -0.6, 68.88, 39.44, -0.6], + [0.08, -39.60, -0.6, 68.88, 39.44, -0.6], + [0.08, -39.60, -1.78, 68.88, 39.44, -1.78], ], sizes=[[0.8, 0.6, 1.73], [1.76, 0.6, 1.73], [3.9, 1.6, 1.56]], rotations=[0, 1.57], @@ -89,5 +91,5 @@ nms_thr=0.01, score_thr=0.1, min_bbox_size=0, - nms_pre=100, - max_num=50)) + nms_pre=4096, + max_num=100)) diff --git a/configs/pointpillars/hv_pointpillars_secfpn_6x8_160e_kitti-3d-3class.py b/configs/pointpillars/hv_pointpillars_secfpn_6x8_160e_kitti-3d-3class.py index 5c5c939de5..2611e86d3a 100644 --- a/configs/pointpillars/hv_pointpillars_secfpn_6x8_160e_kitti-3d-3class.py +++ b/configs/pointpillars/hv_pointpillars_secfpn_6x8_160e_kitti-3d-3class.py @@ -15,21 +15,15 @@ rate=1.0, prepare=dict( filter_by_difficulty=[-1], - filter_by_min_points=dict(Car=5, Pedestrian=10, Cyclist=10)), + filter_by_min_points=dict(Car=5, Pedestrian=5, Cyclist=5)), classes=class_names, - sample_groups=dict(Car=15, Pedestrian=10, Cyclist=10)) + sample_groups=dict(Car=15, Pedestrian=15, Cyclist=15)) # PointPillars uses different augmentation hyper parameters train_pipeline = [ dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), - dict(type='ObjectSample', db_sampler=db_sampler), - dict( - type='ObjectNoise', - num_try=100, - translation_std=[0.25, 0.25, 0.25], - global_rot_range=[0.0, 0.0], - rot_range=[-0.15707963267, 0.15707963267]), + dict(type='ObjectSample', db_sampler=db_sampler, use_ground_plane=False), dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5), dict( type='GlobalRotScaleTrans', diff --git a/mmdet3d/datasets/kitti_dataset.py b/mmdet3d/datasets/kitti_dataset.py index 80676014bb..40de4a367e 100644 --- a/mmdet3d/datasets/kitti_dataset.py +++ b/mmdet3d/datasets/kitti_dataset.py @@ -152,12 +152,29 @@ def get_ann_info(self, index): - gt_bboxes (np.ndarray): 2D ground truth bboxes. - gt_labels (np.ndarray): Labels of ground truths. - gt_names (list[str]): Class names of ground truths. + - difficulty (int): kitti difficulty. """ # Use index to get the annos, thus the evalhook could also use this api info = self.data_infos[index] rect = info['calib']['R0_rect'].astype(np.float32) Trv2c = info['calib']['Tr_velo_to_cam'].astype(np.float32) + if 'plane' in info: + # convert gt_bboxes_3d to velodyne coordinates + reverse = np.linalg.inv(rect @ Trv2c) + + (plane_n_c, plane_pt_c) = (info['plane'][:3], + -info['plane'][:3] * info['plane'][3]) + plane_n_l = (reverse[:3, :3] @ plane_n_c[:, None])[:, 0] + plane_pt_l = ( + reverse[:3, :3] @ plane_pt_c[:, None][:, 0] + reverse[:3, 3]) + plane_l = np.zeros_like(plane_n_l, shape=(4, )) + plane_l[:3] = plane_n_l + plane_l[3] = -plane_n_l.T @ plane_pt_l + else: + plane_l = None + + difficulty = info['annos']['difficulty'] annos = info['annos'] # we need other objects to avoid collision when sample annos = self.remove_dontcare(annos) @@ -191,7 +208,9 @@ def get_ann_info(self, index): gt_labels_3d=gt_labels_3d, bboxes=gt_bboxes, labels=gt_labels, - gt_names=gt_names) + gt_names=gt_names, + plane=plane_l, + difficulty=difficulty) return anns_results def drop_arrays_by_name(self, gt_names, used_classes): diff --git a/mmdet3d/datasets/pipelines/dbsampler.py b/mmdet3d/datasets/pipelines/dbsampler.py index 82e9829db7..981f483f99 100644 --- a/mmdet3d/datasets/pipelines/dbsampler.py +++ b/mmdet3d/datasets/pipelines/dbsampler.py @@ -188,7 +188,7 @@ def filter_by_min_points(db_infos, min_gt_points_dict): db_infos[name] = filtered_infos return db_infos - def sample_all(self, gt_bboxes, gt_labels, img=None): + def sample_all(self, gt_bboxes, gt_labels, img=None, ground_plane=None): """Sampling all categories of bboxes. Args: @@ -263,6 +263,15 @@ def sample_all(self, gt_bboxes, gt_labels, img=None): gt_labels = np.array([self.cat2label[s['name']] for s in sampled], dtype=np.long) + + if ground_plane is not None: + xyz = sampled_gt_bboxes[:, :3] + dz = (ground_plane[:3][None, :] * + xyz).sum(-1) + ground_plane[3] + sampled_gt_bboxes[:, 2] -= dz + for i, s_points in enumerate(s_points_list): + s_points.tensor[:, 2].sub_(dz[i]) + ret = { 'gt_labels_3d': gt_labels, diff --git a/mmdet3d/datasets/pipelines/transforms_3d.py b/mmdet3d/datasets/pipelines/transforms_3d.py index 7045a8d039..a5520ee667 100644 --- a/mmdet3d/datasets/pipelines/transforms_3d.py +++ b/mmdet3d/datasets/pipelines/transforms_3d.py @@ -263,14 +263,17 @@ class ObjectSample(object): sample_2d (bool): Whether to also paste 2D image patch to the images This should be true when applying multi-modality cut-and-paste. Defaults to False. + use_ground_plane (bool): Whether to use gound plane to adjust the + 3D labels. """ - def __init__(self, db_sampler, sample_2d=False): + def __init__(self, db_sampler, sample_2d=False, use_ground_plane=False): self.sampler_cfg = db_sampler self.sample_2d = sample_2d if 'type' not in db_sampler.keys(): db_sampler['type'] = 'DataBaseSampler' self.db_sampler = build_from_cfg(db_sampler, OBJECTSAMPLERS) + self.use_ground_plane = use_ground_plane @staticmethod def remove_points_in_boxes(points, boxes): @@ -301,6 +304,11 @@ def __call__(self, input_dict): gt_bboxes_3d = input_dict['gt_bboxes_3d'] gt_labels_3d = input_dict['gt_labels_3d'] + if self.use_ground_plane and 'plane' in input_dict['ann_info']: + ground_plane = input_dict['ann_info']['plane'] + input_dict['plane'] = ground_plane + else: + ground_plane = None # change to float for blending operation points = input_dict['points'] if self.sample_2d: @@ -314,7 +322,10 @@ def __call__(self, input_dict): img=img) else: sampled_dict = self.db_sampler.sample_all( - gt_bboxes_3d.tensor.numpy(), gt_labels_3d, img=None) + gt_bboxes_3d.tensor.numpy(), + gt_labels_3d, + img=None, + ground_plane=ground_plane) if sampled_dict is not None: sampled_gt_bboxes_3d = sampled_dict['gt_bboxes_3d'] diff --git a/mmdet3d/models/voxel_encoders/pillar_encoder.py b/mmdet3d/models/voxel_encoders/pillar_encoder.py index 45b8d53886..78bac6be10 100644 --- a/mmdet3d/models/voxel_encoders/pillar_encoder.py +++ b/mmdet3d/models/voxel_encoders/pillar_encoder.py @@ -15,7 +15,6 @@ class PillarFeatureNet(nn.Module): The network prepares the pillar features and performs forward pass through PFNLayers. - Args: in_channels (int, optional): Number of input features, either x, y, z or x, y, z, r. Defaults to 4. @@ -54,7 +53,7 @@ def __init__(self, if with_cluster_center: in_channels += 3 if with_voxel_center: - in_channels += 2 + in_channels += 3 if with_distance: in_channels += 1 self._with_distance = with_distance @@ -84,8 +83,10 @@ def __init__(self, # Need pillar (voxel) size and x/y offset in order to calculate offset self.vx = voxel_size[0] self.vy = voxel_size[1] + self.vz = voxel_size[2] self.x_offset = self.vx / 2 + point_cloud_range[0] self.y_offset = self.vy / 2 + point_cloud_range[1] + self.z_offset = self.vz / 2 + point_cloud_range[2] self.point_cloud_range = point_cloud_range @force_fp32(out_fp16=True) @@ -97,7 +98,6 @@ def forward(self, features, num_points, coors): (N, M, C). num_points (torch.Tensor): Number of points in each pillar. coors (torch.Tensor): Coordinates of each voxel. - Returns: torch.Tensor: Features of pillars. """ @@ -114,21 +114,27 @@ def forward(self, features, num_points, coors): dtype = features.dtype if self._with_voxel_center: if not self.legacy: - f_center = torch.zeros_like(features[:, :, :2]) + f_center = torch.zeros_like(features[:, :, :3]) f_center[:, :, 0] = features[:, :, 0] - ( coors[:, 3].to(dtype).unsqueeze(1) * self.vx + self.x_offset) f_center[:, :, 1] = features[:, :, 1] - ( coors[:, 2].to(dtype).unsqueeze(1) * self.vy + self.y_offset) + f_center[:, :, 2] = features[:, :, 2] - ( + coors[:, 1].to(dtype).unsqueeze(1) * self.vz + + self.z_offset) else: - f_center = features[:, :, :2] + f_center = features[:, :, :3] f_center[:, :, 0] = f_center[:, :, 0] - ( coors[:, 3].type_as(features).unsqueeze(1) * self.vx + self.x_offset) f_center[:, :, 1] = f_center[:, :, 1] - ( coors[:, 2].type_as(features).unsqueeze(1) * self.vy + self.y_offset) + f_center[:, :, 2] = f_center[:, :, 2] - ( + coors[:, 1].type_as(features).unsqueeze(1) * self.vz + + self.z_offset) features_ls.append(f_center) if self._with_distance: diff --git a/setup.cfg b/setup.cfg index f998f9c7c9..c1a2151bd2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,7 +8,7 @@ line_length = 79 multi_line_output = 0 known_standard_library = setuptools known_first_party = mmdet,mmseg,mmdet3d -known_third_party = cv2,imageio,indoor3d_util,load_scannet_data,lyft_dataset_sdk,m2r,matplotlib,mmcv,nuimages,numba,numpy,nuscenes,pandas,plyfile,pycocotools,pyquaternion,pytest,pytorch_sphinx_theme,recommonmark,requests,scannet_utils,scipy,seaborn,shapely,skimage,tensorflow,terminaltables,torch,trimesh,ts,waymo_open_dataset +known_third_party = cv2,imageio,indoor3d_util,load_scannet_data,lyft_dataset_sdk,m2r,matplotlib,mmcv,nuimages,numba,numpy,nuscenes,pandas,plyfile,pycocotools,pyquaternion,pytest,pytorch_sphinx_theme,recommonmark,requests,scannet_utils,scipy,seaborn,shapely,skimage,sphinx,tensorflow,terminaltables,torch,trimesh,ts,waymo_open_dataset no_lines_before = STDLIB,LOCALFOLDER default_section = THIRDPARTY From ea5d3d5351e4844bdf98c8ab06b4b922cc3f0108 Mon Sep 17 00:00:00 2001 From: ChaimZhu Date: Mon, 10 Jan 2022 20:03:52 +0800 Subject: [PATCH 2/9] update DynamicPillarFeatureNet --- mmdet3d/models/voxel_encoders/pillar_encoder.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mmdet3d/models/voxel_encoders/pillar_encoder.py b/mmdet3d/models/voxel_encoders/pillar_encoder.py index 78bac6be10..c91cf282ad 100644 --- a/mmdet3d/models/voxel_encoders/pillar_encoder.py +++ b/mmdet3d/models/voxel_encoders/pillar_encoder.py @@ -183,6 +183,8 @@ class DynamicPillarFeatureNet(PillarFeatureNet): Defaults to dict(type='BN1d', eps=1e-3, momentum=0.01). mode (str, optional): The mode to gather point features. Options are 'max' or 'avg'. Defaults to 'max'. + legacy (bool, optional): Whether to use the new behavior or + the original behavior. Defaults to True. """ def __init__(self, @@ -194,7 +196,8 @@ def __init__(self, voxel_size=(0.2, 0.2, 4), point_cloud_range=(0, -40, -3, 70.4, 40, 1), norm_cfg=dict(type='BN1d', eps=1e-3, momentum=0.01), - mode='max'): + mode='max', + legacy=True): super(DynamicPillarFeatureNet, self).__init__( in_channels, feat_channels, @@ -204,7 +207,8 @@ def __init__(self, voxel_size=voxel_size, point_cloud_range=point_cloud_range, norm_cfg=norm_cfg, - mode=mode) + mode=mode, + legacy=legacy) self.fp16_enabled = False feat_channels = [self.in_channels] + list(feat_channels) pfn_layers = [] From 8b258d5fe2c1c520260fb46631fe3433d982cbee Mon Sep 17 00:00:00 2001 From: ChaimZhu Date: Wed, 26 Jan 2022 16:22:37 +0800 Subject: [PATCH 3/9] fix comments --- .../models/hv_pointpillars_secfpn_kitti.py | 7 +++--- mmdet3d/datasets/kitti_dataset.py | 24 +++++++++++-------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/configs/_base_/models/hv_pointpillars_secfpn_kitti.py b/configs/_base_/models/hv_pointpillars_secfpn_kitti.py index bd0312516b..599ea2ce4d 100644 --- a/configs/_base_/models/hv_pointpillars_secfpn_kitti.py +++ b/configs/_base_/models/hv_pointpillars_secfpn_kitti.py @@ -14,8 +14,7 @@ feat_channels=[64], with_distance=False, voxel_size=voxel_size, - point_cloud_range=[0, -39.68, -3, 69.12, 39.68, 1], - legacy=False), + point_cloud_range=[0, -39.68, -3, 69.12, 39.68, 1]), middle_encoder=dict( type='PointPillarsScatter', in_channels=64, output_shape=[496, 432]), backbone=dict( @@ -91,5 +90,5 @@ nms_thr=0.01, score_thr=0.1, min_bbox_size=0, - nms_pre=4096, - max_num=100)) + nms_pre=100, + max_num=50)) diff --git a/mmdet3d/datasets/kitti_dataset.py b/mmdet3d/datasets/kitti_dataset.py index 40de4a367e..0c1c589d2e 100644 --- a/mmdet3d/datasets/kitti_dataset.py +++ b/mmdet3d/datasets/kitti_dataset.py @@ -152,7 +152,8 @@ def get_ann_info(self, index): - gt_bboxes (np.ndarray): 2D ground truth bboxes. - gt_labels (np.ndarray): Labels of ground truths. - gt_names (list[str]): Class names of ground truths. - - difficulty (int): kitti difficulty. + - difficulty (int): Difficulty defined by KITTI. + 0, 1, 2 represent xxxxx respectively. """ # Use index to get the annos, thus the evalhook could also use this api info = self.data_infos[index] @@ -160,17 +161,20 @@ def get_ann_info(self, index): Trv2c = info['calib']['Tr_velo_to_cam'].astype(np.float32) if 'plane' in info: - # convert gt_bboxes_3d to velodyne coordinates + # convert ground plane to velodyne coordinates reverse = np.linalg.inv(rect @ Trv2c) - (plane_n_c, plane_pt_c) = (info['plane'][:3], - -info['plane'][:3] * info['plane'][3]) - plane_n_l = (reverse[:3, :3] @ plane_n_c[:, None])[:, 0] - plane_pt_l = ( - reverse[:3, :3] @ plane_pt_c[:, None][:, 0] + reverse[:3, 3]) - plane_l = np.zeros_like(plane_n_l, shape=(4, )) - plane_l[:3] = plane_n_l - plane_l[3] = -plane_n_l.T @ plane_pt_l + (plane_norm_cam, + plane_off_cam) = (info['plane'][:3], + -info['plane'][:3] * info['plane'][3]) + plane_norm_lidar = \ + (reverse[:3, :3] @ plane_norm_cam[:, None])[:, 0] + plane_off_lidar = ( + reverse[:3, :3] @ plane_off_cam[:, None][:, 0] + + reverse[:3, 3]) + plane_lidar = np.zeros_like(plane_norm_lidar, shape=(4, )) + plane_lidar[:3] = plane_norm_lidar + plane_lidar[3] = -plane_norm_lidar.T @ plane_off_lidar else: plane_l = None From f53e365ea5ee61621573537cf6dcd697ad60e224 Mon Sep 17 00:00:00 2001 From: ChaimZhu Date: Wed, 9 Feb 2022 16:44:25 +0800 Subject: [PATCH 4/9] change to AlignedAnchor3DRangeGenerator --- configs/_base_/models/hv_pointpillars_secfpn_kitti.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/_base_/models/hv_pointpillars_secfpn_kitti.py b/configs/_base_/models/hv_pointpillars_secfpn_kitti.py index bd0312516b..fd723c4e7e 100644 --- a/configs/_base_/models/hv_pointpillars_secfpn_kitti.py +++ b/configs/_base_/models/hv_pointpillars_secfpn_kitti.py @@ -37,11 +37,11 @@ use_direction_classifier=True, assign_per_class=True, anchor_generator=dict( - type='Anchor3DRangeGenerator', + type='AlignedAnchor3DRangeGenerator', ranges=[ - [0.08, -39.60, -0.6, 68.88, 39.44, -0.6], - [0.08, -39.60, -0.6, 68.88, 39.44, -0.6], - [0.08, -39.60, -1.78, 68.88, 39.44, -1.78], + [0, -39.68, -0.6, 69.12, 39.68, -0.6], + [0, -39.68, -0.6, 69.12, 39.68, -0.6], + [0, -39.68, -1.78, 69.12, 39.68, -1.78], ], sizes=[[0.8, 0.6, 1.73], [1.76, 0.6, 1.73], [3.9, 1.6, 1.56]], rotations=[0, 1.57], From 274e638d5d17e9e5fbefa5f615dfd57e1d5eb0c9 Mon Sep 17 00:00:00 2001 From: ChaimZhu Date: Wed, 9 Feb 2022 16:45:44 +0800 Subject: [PATCH 5/9] change to AlignedAnchor3DRangeGenerator --- .../models/hv_pointpillars_secfpn_kitti.py | 7 +++--- mmdet3d/datasets/kitti_dataset.py | 24 +++++++++++-------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/configs/_base_/models/hv_pointpillars_secfpn_kitti.py b/configs/_base_/models/hv_pointpillars_secfpn_kitti.py index fd723c4e7e..ac46475d6e 100644 --- a/configs/_base_/models/hv_pointpillars_secfpn_kitti.py +++ b/configs/_base_/models/hv_pointpillars_secfpn_kitti.py @@ -14,8 +14,7 @@ feat_channels=[64], with_distance=False, voxel_size=voxel_size, - point_cloud_range=[0, -39.68, -3, 69.12, 39.68, 1], - legacy=False), + point_cloud_range=[0, -39.68, -3, 69.12, 39.68, 1]), middle_encoder=dict( type='PointPillarsScatter', in_channels=64, output_shape=[496, 432]), backbone=dict( @@ -91,5 +90,5 @@ nms_thr=0.01, score_thr=0.1, min_bbox_size=0, - nms_pre=4096, - max_num=100)) + nms_pre=100, + max_num=50)) diff --git a/mmdet3d/datasets/kitti_dataset.py b/mmdet3d/datasets/kitti_dataset.py index 40de4a367e..0c1c589d2e 100644 --- a/mmdet3d/datasets/kitti_dataset.py +++ b/mmdet3d/datasets/kitti_dataset.py @@ -152,7 +152,8 @@ def get_ann_info(self, index): - gt_bboxes (np.ndarray): 2D ground truth bboxes. - gt_labels (np.ndarray): Labels of ground truths. - gt_names (list[str]): Class names of ground truths. - - difficulty (int): kitti difficulty. + - difficulty (int): Difficulty defined by KITTI. + 0, 1, 2 represent xxxxx respectively. """ # Use index to get the annos, thus the evalhook could also use this api info = self.data_infos[index] @@ -160,17 +161,20 @@ def get_ann_info(self, index): Trv2c = info['calib']['Tr_velo_to_cam'].astype(np.float32) if 'plane' in info: - # convert gt_bboxes_3d to velodyne coordinates + # convert ground plane to velodyne coordinates reverse = np.linalg.inv(rect @ Trv2c) - (plane_n_c, plane_pt_c) = (info['plane'][:3], - -info['plane'][:3] * info['plane'][3]) - plane_n_l = (reverse[:3, :3] @ plane_n_c[:, None])[:, 0] - plane_pt_l = ( - reverse[:3, :3] @ plane_pt_c[:, None][:, 0] + reverse[:3, 3]) - plane_l = np.zeros_like(plane_n_l, shape=(4, )) - plane_l[:3] = plane_n_l - plane_l[3] = -plane_n_l.T @ plane_pt_l + (plane_norm_cam, + plane_off_cam) = (info['plane'][:3], + -info['plane'][:3] * info['plane'][3]) + plane_norm_lidar = \ + (reverse[:3, :3] @ plane_norm_cam[:, None])[:, 0] + plane_off_lidar = ( + reverse[:3, :3] @ plane_off_cam[:, None][:, 0] + + reverse[:3, 3]) + plane_lidar = np.zeros_like(plane_norm_lidar, shape=(4, )) + plane_lidar[:3] = plane_norm_lidar + plane_lidar[3] = -plane_norm_lidar.T @ plane_off_lidar else: plane_l = None From a1ea78703191cd7dbb288985d80862ed826a3bc6 Mon Sep 17 00:00:00 2001 From: ChaimZhu Date: Wed, 9 Feb 2022 16:51:27 +0800 Subject: [PATCH 6/9] fix --- configs/_base_/models/hv_pointpillars_secfpn_kitti.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/_base_/models/hv_pointpillars_secfpn_kitti.py b/configs/_base_/models/hv_pointpillars_secfpn_kitti.py index ac46475d6e..b7f2f174a1 100644 --- a/configs/_base_/models/hv_pointpillars_secfpn_kitti.py +++ b/configs/_base_/models/hv_pointpillars_secfpn_kitti.py @@ -38,7 +38,7 @@ anchor_generator=dict( type='AlignedAnchor3DRangeGenerator', ranges=[ - [0, -39.68, -0.6, 69.12, 39.68, -0.6], + [0, -39.68, -0.6, 69.12, 39.18, -0.6], [0, -39.68, -0.6, 69.12, 39.68, -0.6], [0, -39.68, -1.78, 69.12, 39.68, -1.78], ], From e5cd8f6ecda65e4a1c05054a404649e61df775bc Mon Sep 17 00:00:00 2001 From: ChaimZhu Date: Wed, 9 Feb 2022 16:56:47 +0800 Subject: [PATCH 7/9] replace with AlignedAnchorGenerator --- configs/_base_/models/hv_pointpillars_secfpn_kitti.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/_base_/models/hv_pointpillars_secfpn_kitti.py b/configs/_base_/models/hv_pointpillars_secfpn_kitti.py index 599ea2ce4d..ac46475d6e 100644 --- a/configs/_base_/models/hv_pointpillars_secfpn_kitti.py +++ b/configs/_base_/models/hv_pointpillars_secfpn_kitti.py @@ -36,11 +36,11 @@ use_direction_classifier=True, assign_per_class=True, anchor_generator=dict( - type='Anchor3DRangeGenerator', + type='AlignedAnchor3DRangeGenerator', ranges=[ - [0.08, -39.60, -0.6, 68.88, 39.44, -0.6], - [0.08, -39.60, -0.6, 68.88, 39.44, -0.6], - [0.08, -39.60, -1.78, 68.88, 39.44, -1.78], + [0, -39.68, -0.6, 69.12, 39.68, -0.6], + [0, -39.68, -0.6, 69.12, 39.68, -0.6], + [0, -39.68, -1.78, 69.12, 39.68, -1.78], ], sizes=[[0.8, 0.6, 1.73], [1.76, 0.6, 1.73], [3.9, 1.6, 1.56]], rotations=[0, 1.57], From e4092a3a01aba7660c430626bd56a9388a0159c7 Mon Sep 17 00:00:00 2001 From: ChaimZhu Date: Thu, 10 Feb 2022 11:04:12 +0800 Subject: [PATCH 8/9] fix lint --- tools/data_converter/kitti_data_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/data_converter/kitti_data_utils.py b/tools/data_converter/kitti_data_utils.py index 206d50d680..8e3dba6f35 100644 --- a/tools/data_converter/kitti_data_utils.py +++ b/tools/data_converter/kitti_data_utils.py @@ -4,6 +4,7 @@ from os import path as osp from pathlib import Path +import mmcv import numpy as np from skimage import io From be6fd847b679da52c946a715f73e0df76fddc4c3 Mon Sep 17 00:00:00 2001 From: ChaimZhu Date: Thu, 10 Feb 2022 11:13:20 +0800 Subject: [PATCH 9/9] update using isort --- mmdet3d/utils/setup_env.py | 3 ++- tests/test_utils/test_setup_env.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mmdet3d/utils/setup_env.py b/mmdet3d/utils/setup_env.py index 282ad491e7..98bcc8853f 100644 --- a/mmdet3d/utils/setup_env.py +++ b/mmdet3d/utils/setup_env.py @@ -1,8 +1,9 @@ # Copyright (c) OpenMMLab. All rights reserved. -import cv2 import os import platform import warnings + +import cv2 from torch import multiprocessing as mp diff --git a/tests/test_utils/test_setup_env.py b/tests/test_utils/test_setup_env.py index 08233efa71..0c070c9f0e 100644 --- a/tests/test_utils/test_setup_env.py +++ b/tests/test_utils/test_setup_env.py @@ -1,8 +1,9 @@ # Copyright (c) OpenMMLab. All rights reserved. -import cv2 import multiprocessing as mp import os import platform + +import cv2 from mmcv import Config from mmdet3d.utils import setup_multi_processes