diff --git a/mmdet3d/datasets/convert_utils.py b/mmdet3d/datasets/convert_utils.py index c05b8c3fa9..7b32332a14 100644 --- a/mmdet3d/datasets/convert_utils.py +++ b/mmdet3d/datasets/convert_utils.py @@ -296,7 +296,7 @@ def get_kitti_style_2d_boxes(info: dict, repro_rec['velocity'] = -1 # no velocity in KITTI center_3d = np.array(loc).reshape([1, 3]) - center_2d_with_depth = box_np_ops.points_cam2img( + center_2d_with_depth = points_cam2img( center_3d, camera_intrinsic, with_depth=True) center_2d_with_depth = center_2d_with_depth.squeeze().tolist() diff --git a/mmdet3d/models/roi_heads/mask_heads/foreground_segmentation_head.py b/mmdet3d/models/roi_heads/mask_heads/foreground_segmentation_head.py index 65ea38fa04..c5581058d7 100644 --- a/mmdet3d/models/roi_heads/mask_heads/foreground_segmentation_head.py +++ b/mmdet3d/models/roi_heads/mask_heads/foreground_segmentation_head.py @@ -3,6 +3,7 @@ import torch from mmcv.cnn.bricks import build_norm_layer +from mmdet.models.utils import multi_apply from mmengine.model import BaseModule from mmengine.structures import InstanceData from torch import nn as nn @@ -10,7 +11,6 @@ from mmdet3d.models.builder import build_loss from mmdet3d.registry import MODELS from mmdet3d.utils import InstanceList -from mmdet.models.utils import multi_apply @MODELS.register_module() diff --git a/mmdet3d/models/roi_heads/pv_rcnn_roi_head.py b/mmdet3d/models/roi_heads/pv_rcnn_roi_head.py index adc001b0b1..1c6011195c 100644 --- a/mmdet3d/models/roi_heads/pv_rcnn_roi_head.py +++ b/mmdet3d/models/roi_heads/pv_rcnn_roi_head.py @@ -2,6 +2,8 @@ from typing import List, Optional import torch +from mmdet.models.task_modules import AssignResult +from mmdet.models.task_modules.samplers import SamplingResult from torch.nn import functional as F from mmdet3d.models.roi_heads.base_3droi_head import Base3DRoIHead @@ -9,8 +11,6 @@ from mmdet3d.structures import bbox3d2roi from mmdet3d.structures.det3d_data_sample import SampleList from mmdet3d.utils import InstanceList -from mmdet.models.task_modules import AssignResult -from mmdet.models.task_modules.samplers import SamplingResult @MODELS.register_module() diff --git a/tools/dataset_converters/update_infos_to_v2.py b/tools/dataset_converters/update_infos_to_v2.py index 087b766013..f60fb273c5 100644 --- a/tools/dataset_converters/update_infos_to_v2.py +++ b/tools/dataset_converters/update_infos_to_v2.py @@ -80,9 +80,6 @@ def get_empty_lidar_points(): num_pts_feats=None, # (str, optional): Path of LiDAR data file. lidar_path=None, - # (list[list[float]]): Transformation matrix from lidar - # or depth to image with shape [4, 4]. - lidar2img=None, # (list[list[float]], optional): Transformation matrix # from lidar to ego-vehicle # with shape [4, 4]. @@ -120,6 +117,9 @@ def get_empty_img_info(): # matrix from camera to image with # shape [3, 3], [3, 4] or [4, 4]. cam2img=None, + # (list[list[float]]): Transformation matrix from lidar + # or depth to image with shape [4, 4]. + lidar2img=None, # (list[list[float]], optional) : Transformation # matrix from camera to ego-vehicle # with shape [4, 4]. @@ -159,7 +159,7 @@ def get_empty_standard_data_info( data_info = dict( # (str): Sample id of the frame. - sample_id=None, + sample_idx=None, # (str, optional): '000010' token=None, **get_single_image_sweep(camera_types), diff --git a/tools/dataset_converters/waymo_converter.py b/tools/dataset_converters/waymo_converter.py index e03d748e51..87385ec774 100644 --- a/tools/dataset_converters/waymo_converter.py +++ b/tools/dataset_converters/waymo_converter.py @@ -69,10 +69,7 @@ def __init__(self, '_SIDE_LEFT', '_SIDE_RIGHT', ] - self.lidar_list = [ - '_FRONT', '_FRONT_RIGHT', '_FRONT_LEFT', '_SIDE_RIGHT', - '_SIDE_LEFT' - ] + self.lidar_list = ['TOP', 'FRONT', 'SIDE_LEFT', 'SIDE_RIGHT', 'REAR'] self.type_list = [ 'UNKNOWN', 'VEHICLE', 'PEDESTRIAN', 'SIGN', 'CYCLIST' ] @@ -135,7 +132,8 @@ def convert_one(self, file_idx): self.save_image(frame, file_idx, frame_idx) self.save_calib(frame, file_idx, frame_idx) - self.save_lidar(frame, file_idx, frame_idx) + if 'testing_3d_camera_only_detection' not in self.load_dir: + self.save_lidar(frame, file_idx, frame_idx) self.save_pose(frame, file_idx, frame_idx) self.save_timestamp(frame, file_idx, frame_idx) @@ -441,7 +439,6 @@ def create_folder(self): dir_list1 = [ self.label_all_save_dir, self.calib_save_dir, - self.point_cloud_save_dir, self.pose_save_dir, self.timestamp_save_dir, ] @@ -451,10 +448,12 @@ def create_folder(self): dir_list2.append(self.cam_sync_label_save_dir) else: dir_list1 = [ - self.calib_save_dir, self.point_cloud_save_dir, - self.pose_save_dir, self.timestamp_save_dir + self.calib_save_dir, self.pose_save_dir, + self.timestamp_save_dir ] dir_list2 = [self.image_save_dir] + if 'testing_3d_camera_only_detection' not in self.load_dir: + dir_list1.append(self.point_cloud_save_dir) for d in dir_list1: mmengine.mkdir_or_exist(d) for d in dir_list2: