diff --git a/configs/3dssd/3dssd_4xb4_kitti-3d-car.py b/configs/3dssd/3dssd_4xb4_kitti-3d-car.py index ff15848723..6fbdfeccfe 100644 --- a/configs/3dssd/3dssd_4xb4_kitti-3d-car.py +++ b/configs/3dssd/3dssd_4xb4_kitti-3d-car.py @@ -9,6 +9,8 @@ class_names = ['Car'] point_cloud_range = [0, -40, -5, 70, 40, 3] input_modality = dict(use_lidar=True, use_camera=False) +backend_args = None + db_sampler = dict( data_root=data_root, info_path=data_root + 'kitti_dbinfos_train.pkl', @@ -17,17 +19,20 @@ classes=class_names, sample_groups=dict(Car=15), points_loader=dict( - type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4)) - -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( -# backend='petrel', path_mapping=dict(data='s3://kitti_data/')) + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), + backend_args=backend_args) train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict(type='PointsRangeFilter', point_cloud_range=point_cloud_range), dict(type='ObjectRangeFilter', point_cloud_range=point_cloud_range), @@ -52,7 +57,12 @@ ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), diff --git a/configs/_base_/datasets/kitti-3d-3class.py b/configs/_base_/datasets/kitti-3d-3class.py index d0de161d61..395f4aafe4 100644 --- a/configs/_base_/datasets/kitti-3d-3class.py +++ b/configs/_base_/datasets/kitti-3d-3class.py @@ -6,6 +6,21 @@ input_modality = dict(use_lidar=True, use_camera=False) metainfo = dict(classes=class_names) +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/kitti/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( +# backend='petrel', +# path_mapping=dict({ +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None + db_sampler = dict( data_root=data_root, info_path=data_root + 'kitti_dbinfos_train.pkl', @@ -16,14 +31,20 @@ classes=class_names, sample_groups=dict(Car=12, Pedestrian=6, Cyclist=6), points_loader=dict( - type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4)) + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), + backend_args=backend_args) train_pipeline = [ dict( type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, # x, y, z, intensity - use_dim=4), + use_dim=4, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict(type='ObjectSample', db_sampler=db_sampler), dict( @@ -45,7 +66,12 @@ keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), @@ -66,7 +92,12 @@ # construct a pipeline for data and gt loading in show function # please keep its loading function consistent with test_pipeline (e.g. client) eval_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict(type='Pack3DDetInputs', keys=['points']) ] train_dataloader = dict( @@ -88,7 +119,8 @@ metainfo=metainfo, # we use box_type_3d='LiDAR' in kitti and nuscenes dataset # and box_type_3d='Depth' in sunrgbd and scannet dataset. - box_type_3d='LiDAR'))) + box_type_3d='LiDAR', + backend_args=backend_args))) val_dataloader = dict( batch_size=1, num_workers=1, @@ -104,7 +136,8 @@ modality=input_modality, test_mode=True, metainfo=metainfo, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) test_dataloader = dict( batch_size=1, num_workers=1, @@ -120,11 +153,13 @@ modality=input_modality, test_mode=True, metainfo=metainfo, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) val_evaluator = dict( type='KittiMetric', ann_file=data_root + 'kitti_infos_val.pkl', - metric='bbox') + metric='bbox', + backend_args=backend_args) test_evaluator = val_evaluator vis_backends = [dict(type='LocalVisBackend')] diff --git a/configs/_base_/datasets/kitti-3d-car.py b/configs/_base_/datasets/kitti-3d-car.py index cfc85413c3..5406f28486 100644 --- a/configs/_base_/datasets/kitti-3d-car.py +++ b/configs/_base_/datasets/kitti-3d-car.py @@ -6,6 +6,21 @@ input_modality = dict(use_lidar=True, use_camera=False) metainfo = dict(classes=class_names) +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/kitti/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( +# backend='petrel', +# path_mapping=dict({ +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None + db_sampler = dict( data_root=data_root, info_path=data_root + 'kitti_dbinfos_train.pkl', @@ -14,14 +29,20 @@ classes=class_names, sample_groups=dict(Car=15), points_loader=dict( - type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4)) + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), + backend_args=backend_args) train_pipeline = [ dict( type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, # x, y, z, intensity - use_dim=4), + use_dim=4, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict(type='ObjectSample', db_sampler=db_sampler), dict( @@ -43,7 +64,12 @@ keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), @@ -64,7 +90,12 @@ # construct a pipeline for data and gt loading in show function # please keep its loading function consistent with test_pipeline (e.g. client) eval_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict(type='Pack3DDetInputs', keys=['points']) ] train_dataloader = dict( @@ -86,7 +117,8 @@ metainfo=metainfo, # we use box_type_3d='LiDAR' in kitti and nuscenes dataset # and box_type_3d='Depth' in sunrgbd and scannet dataset. - box_type_3d='LiDAR'))) + box_type_3d='LiDAR', + backend_args=backend_args))) val_dataloader = dict( batch_size=1, num_workers=1, @@ -102,7 +134,8 @@ modality=input_modality, test_mode=True, metainfo=metainfo, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) test_dataloader = dict( batch_size=1, num_workers=1, @@ -118,11 +151,13 @@ modality=input_modality, test_mode=True, metainfo=metainfo, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) val_evaluator = dict( type='KittiMetric', ann_file=data_root + 'kitti_infos_val.pkl', - metric='bbox') + metric='bbox', + backend_args=backend_args) test_evaluator = val_evaluator vis_backends = [dict(type='LocalVisBackend')] diff --git a/configs/_base_/datasets/kitti-mono3d.py b/configs/_base_/datasets/kitti-mono3d.py index 0bc1267d8f..06cc2873fc 100644 --- a/configs/_base_/datasets/kitti-mono3d.py +++ b/configs/_base_/datasets/kitti-mono3d.py @@ -4,15 +4,23 @@ input_modality = dict(use_lidar=False, use_camera=True) metainfo = dict(classes=class_names) -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( -# backend='petrel', path_mapping=dict(data='s3://kitti_data/')) +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/kitti/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( +# backend='petrel', +# path_mapping=dict({ +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None train_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox=True, @@ -31,12 +39,12 @@ ]), ] test_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict(type='Resize', scale=(1242, 375), keep_ratio=True), dict(type='Pack3DDetInputs', keys=['img']) ] eval_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict(type='Pack3DDetInputs', keys=['img']) ] @@ -57,7 +65,8 @@ metainfo=metainfo, # we use box_type_3d='Camera' in monocular 3d # detection task - box_type_3d='Camera')) + box_type_3d='Camera', + backend_args=backend_args)) val_dataloader = dict( batch_size=1, num_workers=2, @@ -74,13 +83,15 @@ load_type='fov_image_based', metainfo=metainfo, test_mode=True, - box_type_3d='Camera')) + box_type_3d='Camera', + backend_args=backend_args)) test_dataloader = val_dataloader val_evaluator = dict( type='KittiMetric', ann_file=data_root + 'kitti_infos_val.pkl', - metric='bbox') + metric='bbox', + backend_args=backend_args) test_evaluator = val_evaluator diff --git a/configs/_base_/datasets/lyft-3d-range100.py b/configs/_base_/datasets/lyft-3d-range100.py index b4ad57a693..deee22b076 100644 --- a/configs/_base_/datasets/lyft-3d-range100.py +++ b/configs/_base_/datasets/lyft-3d-range100.py @@ -16,19 +16,33 @@ use_radar=False, use_map=False, use_external=False) -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( + +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/lyft/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( # backend='petrel', # path_mapping=dict({ -# './data/lyft/': 's3://lyft/lyft/', -# 'data/lyft/': 's3://lyft/lyft/' -# })) +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None + train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), - dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), + dict( + type='LoadPointsFromMultiSweeps', + sweeps_num=10, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( type='GlobalRotScaleTrans', @@ -44,8 +58,16 @@ keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), - dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), + dict( + type='LoadPointsFromMultiSweeps', + sweeps_num=10, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), @@ -66,8 +88,16 @@ # construct a pipeline for data and gt loading in show function # please keep its loading function consistent with test_pipeline (e.g. client) eval_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), - dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), + dict( + type='LoadPointsFromMultiSweeps', + sweeps_num=10, + backend_args=backend_args), dict(type='Pack3DDetInputs', keys=['points']) ] diff --git a/configs/_base_/datasets/lyft-3d.py b/configs/_base_/datasets/lyft-3d.py index 5ed227feab..f51f259710 100644 --- a/configs/_base_/datasets/lyft-3d.py +++ b/configs/_base_/datasets/lyft-3d.py @@ -13,20 +13,32 @@ input_modality = dict(use_lidar=True, use_camera=False) data_prefix = dict(pts='samples/LIDAR_TOP', img='', sweeps='sweeps/LIDAR_TOP') -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/lyft/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( # backend='petrel', # path_mapping=dict({ -# './data/lyft/': 's3://lyft/lyft/', -# 'data/lyft/': 's3://lyft/lyft/' -# })) +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), - dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), + dict( + type='LoadPointsFromMultiSweeps', + sweeps_num=10, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( type='GlobalRotScaleTrans', @@ -42,8 +54,16 @@ keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), - dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), + dict( + type='LoadPointsFromMultiSweeps', + sweeps_num=10, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), @@ -64,8 +84,16 @@ # construct a pipeline for data and gt loading in show function # please keep its loading function consistent with test_pipeline (e.g. client) eval_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), - dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), + dict( + type='LoadPointsFromMultiSweeps', + sweeps_num=10, + backend_args=backend_args), dict(type='Pack3DDetInputs', keys=['points']) ] train_dataloader = dict( @@ -82,7 +110,8 @@ modality=input_modality, data_prefix=data_prefix, test_mode=False, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) test_dataloader = dict( batch_size=1, num_workers=1, @@ -98,7 +127,8 @@ modality=input_modality, data_prefix=data_prefix, test_mode=True, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) val_dataloader = dict( batch_size=1, num_workers=1, @@ -114,16 +144,19 @@ modality=input_modality, test_mode=True, data_prefix=data_prefix, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) val_evaluator = dict( type='LyftMetric', ann_file=data_root + 'lyft_infos_val.pkl', - metric='bbox') + metric='bbox', + backend_args=backend_args) test_evaluator = dict( type='LyftMetric', ann_file=data_root + 'lyft_infos_val.pkl', - metric='bbox') + metric='bbox', + backend_args=backend_args) vis_backends = [dict(type='LocalVisBackend')] visualizer = dict( diff --git a/configs/_base_/datasets/nuim-instance.py b/configs/_base_/datasets/nuim-instance.py index bd9af457c3..7f731886c0 100644 --- a/configs/_base_/datasets/nuim-instance.py +++ b/configs/_base_/datasets/nuim-instance.py @@ -5,15 +5,23 @@ 'motorcycle', 'pedestrian', 'traffic_cone', 'barrier' ] -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( -# backend='petrel', path_mapping=dict(data='s3://nuimages')) +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/nuimages/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( +# backend='petrel', +# path_mapping=dict({ +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None train_pipeline = [ - dict(type='LoadImageFromFile'), + dict(type='LoadImageFromFile', backend_args=backend_args), dict(type='LoadAnnotations', with_bbox=True, with_mask=True), dict( type='Resize', @@ -24,7 +32,7 @@ dict(type='PackDetInputs'), ] test_pipeline = [ - dict(type='LoadImageFromFile'), + dict(type='LoadImageFromFile', backend_args=backend_args), dict( type='MultiScaleFlipAug', img_scale=(1600, 900), diff --git a/configs/_base_/datasets/nus-3d.py b/configs/_base_/datasets/nus-3d.py index 720bf5d32b..7fe8287c61 100644 --- a/configs/_base_/datasets/nus-3d.py +++ b/configs/_base_/datasets/nus-3d.py @@ -17,20 +17,32 @@ input_modality = dict(use_lidar=True, use_camera=False) data_prefix = dict(pts='samples/LIDAR_TOP', img='', sweeps='sweeps/LIDAR_TOP') -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/nuscenes/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( # backend='petrel', # path_mapping=dict({ -# './data/nuscenes/': 's3://nuscenes/nuscenes/', -# 'data/nuscenes/': 's3://nuscenes/nuscenes/' -# })) +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), - dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), + dict( + type='LoadPointsFromMultiSweeps', + sweeps_num=10, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( type='GlobalRotScaleTrans', @@ -47,8 +59,17 @@ keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), - dict(type='LoadPointsFromMultiSweeps', sweeps_num=10, test_mode=True), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), + dict( + type='LoadPointsFromMultiSweeps', + sweeps_num=10, + test_mode=True, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), @@ -69,8 +90,17 @@ # construct a pipeline for data and gt loading in show function # please keep its loading function consistent with test_pipeline (e.g. client) eval_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), - dict(type='LoadPointsFromMultiSweeps', sweeps_num=10, test_mode=True), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), + dict( + type='LoadPointsFromMultiSweeps', + sweeps_num=10, + test_mode=True, + backend_args=backend_args), dict(type='Pack3DDetInputs', keys=['points']) ] train_dataloader = dict( @@ -89,7 +119,8 @@ data_prefix=data_prefix, # we use box_type_3d='LiDAR' in kitti and nuscenes dataset # and box_type_3d='Depth' in sunrgbd and scannet dataset. - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) test_dataloader = dict( batch_size=1, num_workers=1, @@ -105,7 +136,8 @@ modality=input_modality, data_prefix=data_prefix, test_mode=True, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) val_dataloader = dict( batch_size=1, num_workers=1, @@ -121,13 +153,15 @@ modality=input_modality, test_mode=True, data_prefix=data_prefix, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) val_evaluator = dict( type='NuScenesMetric', data_root=data_root, ann_file=data_root + 'nuscenes_infos_val.pkl', - metric='bbox') + metric='bbox', + backend_args=backend_args) test_evaluator = val_evaluator vis_backends = [dict(type='LocalVisBackend')] diff --git a/configs/_base_/datasets/nus-mono3d.py b/configs/_base_/datasets/nus-mono3d.py index 9b73523b78..f7cb1b3b24 100644 --- a/configs/_base_/datasets/nus-mono3d.py +++ b/configs/_base_/datasets/nus-mono3d.py @@ -9,21 +9,23 @@ # format which requires the information in input_modality. input_modality = dict(use_lidar=False, use_camera=True) -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/nuscenes/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( # backend='petrel', # path_mapping=dict({ -# './data/nuscenes/': -# 's3://openmmlab/datasets/detection3d/nuscenes/', -# 'data/nuscenes/': -# 's3://openmmlab/datasets/detection3d/nuscenes/' -# })) +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None train_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox=True, @@ -43,7 +45,7 @@ ] test_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict(type='mmdet.Resize', scale=(1600, 900), keep_ratio=True), dict(type='Pack3DDetInputs', keys=['img']) ] @@ -73,7 +75,8 @@ # we use box_type_3d='Camera' in monocular 3d # detection task box_type_3d='Camera', - use_valid_flag=True)) + use_valid_flag=True, + backend_args=backend_args)) val_dataloader = dict( batch_size=1, num_workers=2, @@ -98,14 +101,16 @@ metainfo=metainfo, test_mode=True, box_type_3d='Camera', - use_valid_flag=True)) + use_valid_flag=True, + backend_args=backend_args)) test_dataloader = val_dataloader val_evaluator = dict( type='NuScenesMetric', data_root=data_root, ann_file=data_root + 'nuscenes_infos_val.pkl', - metric='bbox') + metric='bbox', + backend_args=backend_args) test_evaluator = val_evaluator diff --git a/configs/_base_/datasets/s3dis-3d.py b/configs/_base_/datasets/s3dis-3d.py index 07d06d3eb8..9eb48d7c26 100644 --- a/configs/_base_/datasets/s3dis-3d.py +++ b/configs/_base_/datasets/s3dis-3d.py @@ -2,6 +2,21 @@ dataset_type = 'S3DISDataset' data_root = 'data/s3dis/' +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/s3dis/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( +# backend='petrel', +# path_mapping=dict({ +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None + metainfo = dict(classes=('table', 'chair', 'sofa', 'bookcase', 'board')) train_area = [1, 2, 3, 4, 6] test_area = 5 @@ -13,7 +28,8 @@ shift_height=False, use_color=True, load_dim=6, - use_dim=[0, 1, 2, 3, 4, 5]), + use_dim=[0, 1, 2, 3, 4, 5], + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict(type='PointSample', num_points=100000), dict( @@ -39,7 +55,8 @@ shift_height=False, use_color=True, load_dim=6, - use_dim=[0, 1, 2, 3, 4, 5]), + use_dim=[0, 1, 2, 3, 4, 5], + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), @@ -79,7 +96,8 @@ pipeline=train_pipeline, filter_empty_gt=True, metainfo=metainfo, - box_type_3d='Depth') for i in train_area + box_type_3d='Depth', + backend_args=backend_args) for i in train_area ]))) val_dataloader = dict( @@ -93,7 +111,8 @@ pipeline=test_pipeline, metainfo=metainfo, test_mode=True, - box_type_3d='Depth')) + box_type_3d='Depth', + backend_args=backend_args)) test_dataloader = dict( batch_size=1, num_workers=1, @@ -105,7 +124,8 @@ pipeline=test_pipeline, metainfo=metainfo, test_mode=True, - box_type_3d='Depth')) + box_type_3d='Depth', + backend_args=backend_args)) val_evaluator = dict(type='IndoorMetric') test_evaluator = val_evaluator diff --git a/configs/_base_/datasets/s3dis-seg.py b/configs/_base_/datasets/s3dis-seg.py index 7e354b1bc1..88013ffacd 100644 --- a/configs/_base_/datasets/s3dis-seg.py +++ b/configs/_base_/datasets/s3dis-seg.py @@ -10,16 +10,20 @@ pts_instance_mask='instance_mask', pts_semantic_mask='semantic_mask') -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/s3dis/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( # backend='petrel', # path_mapping=dict({ -# './data/s3dis/': -# 's3://s3dis/', -# })) +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None num_points = 4096 train_area = [1, 2, 3, 4, 6] @@ -31,13 +35,15 @@ shift_height=False, use_color=True, load_dim=6, - use_dim=[0, 1, 2, 3, 4, 5]), + use_dim=[0, 1, 2, 3, 4, 5], + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=False, with_label_3d=False, with_mask_3d=False, - with_seg_3d=True), + with_seg_3d=True, + backend_args=backend_args), dict(type='PointSegClassMapping'), dict( type='IndoorPatchPointSample', @@ -57,13 +63,15 @@ shift_height=False, use_color=True, load_dim=6, - use_dim=[0, 1, 2, 3, 4, 5]), + use_dim=[0, 1, 2, 3, 4, 5], + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=False, with_label_3d=False, with_mask_3d=False, - with_seg_3d=True), + with_seg_3d=True, + backend_args=backend_args), dict(type='NormalizePointsColor', color_mean=None), dict( # a wrapper in order to successfully call test function @@ -96,7 +104,8 @@ shift_height=False, use_color=True, load_dim=6, - use_dim=[0, 1, 2, 3, 4, 5]), + use_dim=[0, 1, 2, 3, 4, 5], + backend_args=backend_args), dict(type='NormalizePointsColor', color_mean=None), dict(type='Pack3DDetInputs', keys=['points']) ] @@ -120,7 +129,8 @@ scene_idxs=[ f'seg_info/Area_{i}_resampled_scene_idxs.npy' for i in train_area ], - test_mode=False)) + test_mode=False, + backend_args=backend_args)) test_dataloader = dict( batch_size=1, num_workers=1, @@ -137,7 +147,8 @@ modality=input_modality, ignore_index=len(class_names), scene_idxs=f'seg_info/Area_{test_area}_resampled_scene_idxs.npy', - test_mode=True)) + test_mode=True, + backend_args=backend_args)) val_dataloader = test_dataloader val_evaluator = dict(type='SegMetric') diff --git a/configs/_base_/datasets/scannet-3d.py b/configs/_base_/datasets/scannet-3d.py index 66eb3f22a9..1c0d88c3ce 100644 --- a/configs/_base_/datasets/scannet-3d.py +++ b/configs/_base_/datasets/scannet-3d.py @@ -8,16 +8,20 @@ 'refrigerator', 'showercurtrain', 'toilet', 'sink', 'bathtub', 'garbagebin')) -# file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/scannet/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( # backend='petrel', # path_mapping=dict({ -# './data/scannet/': -# 's3://scannet/', -# })) +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None train_pipeline = [ dict( @@ -25,13 +29,15 @@ coord_type='DEPTH', shift_height=True, load_dim=6, - use_dim=[0, 1, 2]), + use_dim=[0, 1, 2], + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True, with_mask_3d=True, - with_seg_3d=True), + with_seg_3d=True, + backend_args=backend_args), dict(type='GlobalAlignment', rotation_axis=2), dict(type='PointSegClassMapping'), dict(type='PointSample', num_points=40000), @@ -58,7 +64,8 @@ coord_type='DEPTH', shift_height=True, load_dim=6, - use_dim=[0, 1, 2]), + use_dim=[0, 1, 2], + backend_args=backend_args), dict(type='GlobalAlignment', rotation_axis=2), dict( type='MultiScaleFlipAug3D', @@ -97,7 +104,8 @@ metainfo=metainfo, # we use box_type_3d='LiDAR' in kitti and nuscenes dataset # and box_type_3d='Depth' in sunrgbd and scannet dataset. - box_type_3d='Depth'))) + box_type_3d='Depth', + backend_args=backend_args))) val_dataloader = dict( batch_size=1, @@ -110,7 +118,8 @@ pipeline=test_pipeline, metainfo=metainfo, test_mode=True, - box_type_3d='Depth')) + box_type_3d='Depth', + backend_args=backend_args)) test_dataloader = dict( batch_size=1, num_workers=1, @@ -122,7 +131,8 @@ pipeline=test_pipeline, metainfo=metainfo, test_mode=True, - box_type_3d='Depth')) + box_type_3d='Depth', + backend_args=backend_args)) val_evaluator = dict(type='IndoorMetric') test_evaluator = val_evaluator diff --git a/configs/_base_/datasets/scannet-seg.py b/configs/_base_/datasets/scannet-seg.py index 129148aea8..df68332434 100644 --- a/configs/_base_/datasets/scannet-seg.py +++ b/configs/_base_/datasets/scannet-seg.py @@ -12,16 +12,20 @@ pts_instance_mask='instance_mask', pts_semantic_mask='semantic_mask') -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/scannet/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( # backend='petrel', # path_mapping=dict({ -# './data/scannet/': -# 's3://scannet/', -# })) +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None num_points = 8192 train_pipeline = [ @@ -31,13 +35,15 @@ shift_height=False, use_color=True, load_dim=6, - use_dim=[0, 1, 2, 3, 4, 5]), + use_dim=[0, 1, 2, 3, 4, 5], + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=False, with_label_3d=False, with_mask_3d=False, - with_seg_3d=True), + with_seg_3d=True, + backend_args=backend_args), dict(type='PointSegClassMapping'), dict( type='IndoorPatchPointSample', @@ -57,13 +63,15 @@ shift_height=False, use_color=True, load_dim=6, - use_dim=[0, 1, 2, 3, 4, 5]), + use_dim=[0, 1, 2, 3, 4, 5], + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=False, with_label_3d=False, with_mask_3d=False, - with_seg_3d=True), + with_seg_3d=True, + backend_args=backend_args), dict(type='NormalizePointsColor', color_mean=None), dict( # a wrapper in order to successfully call test function @@ -96,7 +104,8 @@ shift_height=False, use_color=True, load_dim=6, - use_dim=[0, 1, 2, 3, 4, 5]), + use_dim=[0, 1, 2, 3, 4, 5], + backend_args=backend_args), dict(type='NormalizePointsColor', color_mean=None), dict(type='Pack3DDetInputs', keys=['points']) ] @@ -116,7 +125,8 @@ modality=input_modality, ignore_index=len(class_names), scene_idxs=data_root + 'seg_info/train_resampled_scene_idxs.npy', - test_mode=False)) + test_mode=False, + backend_args=backend_args)) test_dataloader = dict( batch_size=1, num_workers=1, @@ -132,7 +142,8 @@ pipeline=test_pipeline, modality=input_modality, ignore_index=len(class_names), - test_mode=True)) + test_mode=True, + backend_args=backend_args)) val_dataloader = test_dataloader val_evaluator = dict(type='SegMetric') diff --git a/configs/_base_/datasets/semantickitti.py b/configs/_base_/datasets/semantickitti.py index 445ab6bdf5..9ad3e1e78a 100644 --- a/configs/_base_/datasets/semantickitti.py +++ b/configs/_base_/datasets/semantickitti.py @@ -75,16 +75,20 @@ input_modality = dict(use_lidar=True, use_camera=False) -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/semantickitti/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( # backend='petrel', # path_mapping=dict({ -# './data/semantickitti/': -# 's3://semantickitti/', -# })) +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None train_pipeline = [ dict( @@ -92,12 +96,13 @@ coord_type='LIDAR', load_dim=4, use_dim=4, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadAnnotations3D', with_seg_3d=True, seg_offset=2**16, - dataset_type='semantickitti'), + dataset_type='semantickitti', + backend_args=backend_args), dict(type='PointSegClassMapping', ), dict( type='RandomFlip3D', @@ -118,12 +123,13 @@ coord_type='LIDAR', load_dim=4, use_dim=4, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadAnnotations3D', with_seg_3d=True, seg_offset=2**16, - dataset_type='semantickitti'), + dataset_type='semantickitti', + backend_args=backend_args), dict(type='PointSegClassMapping', ), dict(type='Pack3DDetInputs', keys=['points', 'pts_semantic_mask']) ] @@ -135,12 +141,13 @@ coord_type='LIDAR', load_dim=4, use_dim=4, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadAnnotations3D', with_seg_3d=True, seg_offset=2**16, - dataset_type='semantickitti'), + dataset_type='semantickitti', + backend_args=backend_args), dict(type='PointSegClassMapping', ), dict(type='Pack3DDetInputs', keys=['points', 'pts_semantic_mask']) ] @@ -158,7 +165,8 @@ ann_file='train_infos.pkl', pipeline=train_pipeline, metainfo=metainfo, - modality=input_modality)), + modality=input_modality, + backend_args=backend_args)), ) test_dataloader = dict( @@ -176,7 +184,7 @@ metainfo=metainfo, modality=input_modality, test_mode=True, - )), + backend_args=backend_args)), ) val_dataloader = test_dataloader diff --git a/configs/_base_/datasets/sunrgbd-3d.py b/configs/_base_/datasets/sunrgbd-3d.py index e2481530df..b097d26088 100644 --- a/configs/_base_/datasets/sunrgbd-3d.py +++ b/configs/_base_/datasets/sunrgbd-3d.py @@ -5,16 +5,20 @@ metainfo = dict(classes=class_names) -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/sunrgbd/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( # backend='petrel', # path_mapping=dict({ -# './data/sunrgbd/': -# 's3://sunrgbd/', -# })) +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None train_pipeline = [ dict( @@ -22,7 +26,8 @@ coord_type='DEPTH', shift_height=True, load_dim=6, - use_dim=[0, 1, 2]), + use_dim=[0, 1, 2], + backend_args=backend_args), dict(type='LoadAnnotations3D'), dict( type='RandomFlip3D', @@ -45,7 +50,8 @@ coord_type='DEPTH', shift_height=True, load_dim=6, - use_dim=[0, 1, 2]), + use_dim=[0, 1, 2], + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), @@ -83,7 +89,8 @@ metainfo=metainfo, # we use box_type_3d='LiDAR' in kitti and nuscenes dataset # and box_type_3d='Depth' in sunrgbd and scannet dataset. - box_type_3d='Depth'))) + box_type_3d='Depth', + backend_args=backend_args))) val_dataloader = dict( batch_size=1, @@ -96,7 +103,8 @@ pipeline=test_pipeline, metainfo=metainfo, test_mode=True, - box_type_3d='Depth')) + box_type_3d='Depth', + backend_args=backend_args)) test_dataloader = dict( batch_size=1, num_workers=1, @@ -108,7 +116,8 @@ pipeline=test_pipeline, metainfo=metainfo, test_mode=True, - box_type_3d='Depth')) + box_type_3d='Depth', + backend_args=backend_args)) val_evaluator = dict(type='IndoorMetric') test_evaluator = val_evaluator diff --git a/configs/_base_/datasets/waymoD5-3d-3class.py b/configs/_base_/datasets/waymoD5-3d-3class.py index 83d3abe917..b546366148 100644 --- a/configs/_base_/datasets/waymoD5-3d-3class.py +++ b/configs/_base_/datasets/waymoD5-3d-3class.py @@ -4,16 +4,21 @@ dataset_type = 'WaymoDataset' # data_root = 's3://openmmlab/datasets/detection3d/waymo/kitti_format/' data_root = 'data/waymo/kitti_format/' -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( + +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/waymo/kitti_format/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( # backend='petrel', -# path_mapping={ -# './data/waymo': 's3://openmmlab/datasets/detection3d/waymo', -# 'data/waymo': 's3://openmmlab/datasets/detection3d/waymo' -# }) +# path_mapping=dict({ +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None class_names = ['Car', 'Pedestrian', 'Cyclist'] metainfo = dict(classes=class_names) @@ -33,10 +38,17 @@ type='LoadPointsFromFile', coord_type='LIDAR', load_dim=6, - use_dim=[0, 1, 2, 3, 4])) + use_dim=[0, 1, 2, 3, 4], + backend_args=backend_args), + backend_args=backend_args) train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=6, use_dim=5), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=6, + use_dim=5, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), # dict(type='ObjectSample', db_sampler=db_sampler), dict( @@ -61,7 +73,7 @@ coord_type='LIDAR', load_dim=6, use_dim=5, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), @@ -82,7 +94,12 @@ # construct a pipeline for data and gt loading in show function # please keep its loading function consistent with test_pipeline (e.g. client) eval_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=6, use_dim=5), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=6, + use_dim=5, + backend_args=backend_args), dict(type='Pack3DDetInputs', keys=['points']), ] @@ -109,7 +126,7 @@ box_type_3d='LiDAR', # load one frame every five frames load_interval=5, - file_client_args=file_client_args))) + backend_args=backend_args))) val_dataloader = dict( batch_size=1, num_workers=1, @@ -126,7 +143,7 @@ test_mode=True, metainfo=metainfo, box_type_3d='LiDAR', - file_client_args=file_client_args)) + backend_args=backend_args)) test_dataloader = dict( batch_size=1, @@ -144,14 +161,14 @@ test_mode=True, metainfo=metainfo, box_type_3d='LiDAR', - file_client_args=file_client_args)) + backend_args=backend_args)) val_evaluator = dict( type='WaymoMetric', ann_file='./data/waymo/kitti_format/waymo_infos_val.pkl', waymo_bin_file='./data/waymo/waymo_format/gt.bin', data_root='./data/waymo/waymo_format', - file_client_args=file_client_args, + backend_args=backend_args, convert_kitti_format=False) test_evaluator = val_evaluator diff --git a/configs/_base_/datasets/waymoD5-3d-car.py b/configs/_base_/datasets/waymoD5-3d-car.py index 70292d9a8c..d37a7cc43e 100644 --- a/configs/_base_/datasets/waymoD5-3d-car.py +++ b/configs/_base_/datasets/waymoD5-3d-car.py @@ -3,12 +3,21 @@ # We only use one fold for efficient experiments dataset_type = 'WaymoDataset' data_root = 'data/waymo/kitti_format/' -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( -# backend='petrel', path_mapping=dict(data='s3://waymo_data/')) + +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/waymo/kitti_format/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( +# backend='petrel', +# path_mapping=dict({ +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None class_names = ['Car'] metainfo = dict(classes=class_names) @@ -26,10 +35,17 @@ type='LoadPointsFromFile', coord_type='LIDAR', load_dim=6, - use_dim=[0, 1, 2, 3, 4])) + use_dim=[0, 1, 2, 3, 4], + backend_args=backend_args), + backend_args=backend_args) train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=6, use_dim=5), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=6, + use_dim=5, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict(type='ObjectSample', db_sampler=db_sampler), dict( @@ -49,7 +65,12 @@ keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=6, use_dim=5), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=6, + use_dim=5, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), @@ -70,7 +91,12 @@ # construct a pipeline for data and gt loading in show function # please keep its loading function consistent with test_pipeline (e.g. client) eval_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=6, use_dim=5), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=6, + use_dim=5, + backend_args=backend_args), dict(type='Pack3DDetInputs', keys=['points']), ] @@ -96,7 +122,8 @@ # and box_type_3d='Depth' in sunrgbd and scannet dataset. box_type_3d='LiDAR', # load one frame every five frames - load_interval=5))) + load_interval=5, + backend_args=backend_args))) val_dataloader = dict( batch_size=1, num_workers=1, @@ -112,7 +139,8 @@ modality=input_modality, test_mode=True, metainfo=metainfo, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) test_dataloader = dict( batch_size=1, @@ -129,14 +157,16 @@ modality=input_modality, test_mode=True, metainfo=metainfo, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) val_evaluator = dict( type='WaymoMetric', ann_file='./data/waymo/kitti_format/waymo_infos_val.pkl', waymo_bin_file='./data/waymo/waymo_format/gt.bin', data_root='./data/waymo/waymo_format', - convert_kitti_format=False) + convert_kitti_format=False, + backend_args=backend_args) test_evaluator = val_evaluator vis_backends = [dict(type='LocalVisBackend')] diff --git a/configs/_base_/datasets/waymoD5-fov-mono3d-3class.py b/configs/_base_/datasets/waymoD5-fov-mono3d-3class.py index 6e8a16c6eb..c3a5806608 100644 --- a/configs/_base_/datasets/waymoD5-fov-mono3d-3class.py +++ b/configs/_base_/datasets/waymoD5-fov-mono3d-3class.py @@ -5,12 +5,24 @@ data_root = 'data/waymo/kitti_format/' class_names = ['Car', 'Pedestrian', 'Cyclist'] input_modality = dict(use_lidar=False, use_camera=True) -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. + +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/waymo/kitti_format/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( +# backend='petrel', +# path_mapping=dict({ +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None + train_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox=True, @@ -36,7 +48,7 @@ ] test_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict( type='RandomResize3D', scale=(1248, 832), @@ -47,7 +59,7 @@ # construct a pipeline for data and gt loading in show function # please keep its loading function consistent with test_pipeline (e.g. client) eval_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict( type='RandomResize3D', scale=(1248, 832), @@ -83,7 +95,8 @@ box_type_3d='Camera', load_type='fov_image_based', # load one frame every three frames - load_interval=5)) + load_interval=5, + backend_args=backend_args)) val_dataloader = dict( batch_size=1, @@ -110,7 +123,7 @@ # and box_type_3d='Depth' in sunrgbd and scannet dataset. box_type_3d='Camera', load_type='fov_image_based', - )) + backend_args=backend_args)) test_dataloader = dict( batch_size=1, @@ -137,7 +150,7 @@ # and box_type_3d='Depth' in sunrgbd and scannet dataset. box_type_3d='Camera', load_type='fov_image_based', - )) + backend_args=backend_args)) val_evaluator = dict( type='WaymoMetric', @@ -146,5 +159,5 @@ data_root='./data/waymo/waymo_format', metric='LET_mAP', load_type='fov_image_based', -) + backend_args=backend_args) test_evaluator = val_evaluator diff --git a/configs/_base_/datasets/waymoD5-mv-mono3d-3class.py b/configs/_base_/datasets/waymoD5-mv-mono3d-3class.py index 8a6115cc97..9250d1a235 100644 --- a/configs/_base_/datasets/waymoD5-mv-mono3d-3class.py +++ b/configs/_base_/datasets/waymoD5-mv-mono3d-3class.py @@ -5,12 +5,24 @@ data_root = 'data/waymo/kitti_format/' class_names = ['Car', 'Pedestrian', 'Cyclist'] input_modality = dict(use_lidar=False, use_camera=True) -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. + +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/waymo/kitti_format/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( +# backend='petrel', +# path_mapping=dict({ +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None + train_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox=True, @@ -36,7 +48,7 @@ ] test_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict( type='RandomResize3D', scale=(1248, 832), @@ -47,7 +59,7 @@ # construct a pipeline for data and gt loading in show function # please keep its loading function consistent with test_pipeline (e.g. client) eval_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict( type='RandomResize3D', scale=(1248, 832), @@ -83,7 +95,8 @@ box_type_3d='Camera', load_type='mv_image_based', # load one frame every three frames - load_interval=5)) + load_interval=5, + backend_args=backend_args)) val_dataloader = dict( batch_size=1, @@ -110,7 +123,7 @@ # and box_type_3d='Depth' in sunrgbd and scannet dataset. box_type_3d='Camera', load_type='mv_image_based', - )) + backend_args=backend_args)) test_dataloader = dict( batch_size=1, @@ -137,7 +150,7 @@ # and box_type_3d='Depth' in sunrgbd and scannet dataset. box_type_3d='Camera', load_type='mv_image_based', - )) + backend_args=backend_args)) val_evaluator = dict( type='WaymoMetric', @@ -146,5 +159,5 @@ data_root='./data/waymo/waymo_format', metric='LET_mAP', load_type='mv_image_based', -) + backend_args=backend_args) test_evaluator = val_evaluator diff --git a/configs/_base_/datasets/waymoD5-mv3d-3class.py b/configs/_base_/datasets/waymoD5-mv3d-3class.py index e9cf494b3a..beb30c9def 100644 --- a/configs/_base_/datasets/waymoD5-mv3d-3class.py +++ b/configs/_base_/datasets/waymoD5-mv3d-3class.py @@ -3,10 +3,21 @@ # We only use one fold for efficient experiments dataset_type = 'WaymoDataset' data_root = 'data/waymo/kitti_format/' -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. + +# Example to use different file client +# Method 1: simply set the data root and let the file I/O module +# automatically infer from prefix (not support LMDB and Memcache yet) + +# data_root = 's3://openmmlab/datasets/detection3d/waymo/kitti_format/' + +# Method 2: Use backend_args, file_client_args in versions before 1.1.0rc4 +# backend_args = dict( +# backend='petrel', +# path_mapping=dict({ +# './data/': 's3://openmmlab/datasets/detection3d/', +# 'data/': 's3://openmmlab/datasets/detection3d/' +# })) +backend_args = None class_names = ['Car', 'Pedestrian', 'Cyclist'] input_modality = dict(use_lidar=False, use_camera=True) @@ -24,7 +35,10 @@ ] train_pipeline = [ - dict(type='LoadMultiViewImageFromFiles', to_float32=True), + dict( + type='LoadMultiViewImageFromFiles', + to_float32=True, + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox=True, @@ -51,14 +65,20 @@ keep_ratio=True) ] test_pipeline = [ - dict(type='LoadMultiViewImageFromFiles', to_float32=True), + dict( + type='LoadMultiViewImageFromFiles', + to_float32=True, + backend_args=backend_args), dict(type='MultiViewWrapper', transforms=test_transforms), dict(type='Pack3DDetInputs', keys=['img']) ] # construct a pipeline for data and gt loading in show function # please keep its loading function consistent with test_pipeline (e.g. client) eval_pipeline = [ - dict(type='LoadMultiViewImageFromFiles', to_float32=True), + dict( + type='LoadMultiViewImageFromFiles', + to_float32=True, + backend_args=backend_args), dict(type='MultiViewWrapper', transforms=test_transforms), dict(type='Pack3DDetInputs', keys=['img']) ] @@ -86,7 +106,7 @@ metainfo=metainfo, box_type_3d='Lidar', load_interval=5, - )) + backend_args=backend_args)) val_dataloader = dict( batch_size=1, @@ -110,7 +130,7 @@ test_mode=True, metainfo=metainfo, box_type_3d='Lidar', - )) + backend_args=backend_args)) test_dataloader = dict( batch_size=1, @@ -134,12 +154,13 @@ test_mode=True, metainfo=metainfo, box_type_3d='Lidar', - )) + backend_args=backend_args)) val_evaluator = dict( type='WaymoMetric', ann_file='./data/waymo/kitti_format/waymo_infos_val.pkl', waymo_bin_file='./data/waymo/waymo_format/cam_gt.bin', data_root='./data/waymo/waymo_format', - metric='LET_mAP') + metric='LET_mAP', + backend_args=backend_args) test_evaluator = val_evaluator diff --git a/configs/centerpoint/README.md b/configs/centerpoint/README.md index 5361df2035..f942657dad 100644 --- a/configs/centerpoint/README.md +++ b/configs/centerpoint/README.md @@ -56,7 +56,7 @@ model = dict( max_num=83))) point_cloud_range = [-54, -54, -5.0, 54, 54, 3.0] -file_client_args = dict(backend='disk') +backend_args = None class_names = [ 'car', 'truck', 'construction_vehicle', 'bus', 'trailer', 'barrier', 'motorcycle', 'bicycle', 'pedestrian', 'traffic_cone' @@ -67,12 +67,12 @@ test_pipeline = [ type='LoadPointsFromFile', load_dim=5, use_dim=5, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=9, use_dim=[0, 1, 2, 3, 4], - file_client_args=file_client_args, + backend_args=backend_args, pad_empty_sweeps=True, remove_close=True), dict( diff --git a/configs/centerpoint/centerpoint_pillar02_second_secfpn_8xb4-cyclic-20e_nus-3d.py b/configs/centerpoint/centerpoint_pillar02_second_secfpn_8xb4-cyclic-20e_nus-3d.py index 168e60843a..a6854b22b9 100644 --- a/configs/centerpoint/centerpoint_pillar02_second_secfpn_8xb4-cyclic-20e_nus-3d.py +++ b/configs/centerpoint/centerpoint_pillar02_second_secfpn_8xb4-cyclic-20e_nus-3d.py @@ -27,7 +27,7 @@ dataset_type = 'NuScenesDataset' data_root = 'data/nuscenes/' -file_client_args = dict(backend='disk') +backend_args = None db_sampler = dict( data_root=data_root, @@ -62,16 +62,24 @@ type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, - use_dim=[0, 1, 2, 3, 4])) + use_dim=[0, 1, 2, 3, 4], + backend_args=backend_args), + backend_args=backend_args) train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=9, use_dim=[0, 1, 2, 3, 4], pad_empty_sweeps=True, - remove_close=True), + remove_close=True, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict(type='ObjectSample', db_sampler=db_sampler), dict( @@ -93,13 +101,19 @@ keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=9, use_dim=[0, 1, 2, 3, 4], pad_empty_sweeps=True, - remove_close=True), + remove_close=True, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), @@ -135,7 +149,8 @@ use_valid_flag=True, # we use box_type_3d='LiDAR' in kitti and nuscenes dataset # and box_type_3d='Depth' in sunrgbd and scannet dataset. - box_type_3d='LiDAR'))) + box_type_3d='LiDAR', + backend_args=backend_args))) test_dataloader = dict( dataset=dict(pipeline=test_pipeline, metainfo=dict(classes=class_names))) val_dataloader = dict( diff --git a/configs/centerpoint/centerpoint_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d.py b/configs/centerpoint/centerpoint_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d.py index c89046cc27..a7d675598e 100644 --- a/configs/centerpoint/centerpoint_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d.py +++ b/configs/centerpoint/centerpoint_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d.py @@ -31,7 +31,7 @@ dataset_type = 'NuScenesDataset' data_root = 'data/nuscenes/' -file_client_args = dict(backend='disk') +backend_args = None db_sampler = dict( data_root=data_root, @@ -66,16 +66,24 @@ type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, - use_dim=[0, 1, 2, 3, 4])) + use_dim=[0, 1, 2, 3, 4], + backend_args=backend_args), + backend_args=backend_args) train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=9, use_dim=[0, 1, 2, 3, 4], pad_empty_sweeps=True, - remove_close=True), + remove_close=True, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict(type='ObjectSample', db_sampler=db_sampler), dict( @@ -97,13 +105,19 @@ keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=9, use_dim=[0, 1, 2, 3, 4], pad_empty_sweeps=True, - remove_close=True), + remove_close=True, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), diff --git a/configs/centerpoint/centerpoint_voxel0075_second_secfpn_head-dcn-circlenms_8xb4-flip-tta-cyclic-20e_nus-3d.py b/configs/centerpoint/centerpoint_voxel0075_second_secfpn_head-dcn-circlenms_8xb4-flip-tta-cyclic-20e_nus-3d.py index 51f27f43a6..5625883a53 100644 --- a/configs/centerpoint/centerpoint_voxel0075_second_secfpn_head-dcn-circlenms_8xb4-flip-tta-cyclic-20e_nus-3d.py +++ b/configs/centerpoint/centerpoint_voxel0075_second_secfpn_head-dcn-circlenms_8xb4-flip-tta-cyclic-20e_nus-3d.py @@ -5,20 +5,26 @@ # Using calibration info convert the Lidar-coordinate point cloud range to the # ego-coordinate point cloud range could bring a little promotion in nuScenes. # point_cloud_range = [-54, -54.8, -5.0, 54, 53.2, 3.0] -file_client_args = dict(backend='disk') +backend_args = None class_names = [ 'car', 'truck', 'construction_vehicle', 'bus', 'trailer', 'barrier', 'motorcycle', 'bicycle', 'pedestrian', 'traffic_cone' ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=9, use_dim=[0, 1, 2, 3, 4], pad_empty_sweeps=True, - remove_close=True), + remove_close=True, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), diff --git a/configs/centerpoint/centerpoint_voxel0075_second_secfpn_head-dcn_8xb4-flip-tta-cyclic-20e_nus-3d.py b/configs/centerpoint/centerpoint_voxel0075_second_secfpn_head-dcn_8xb4-flip-tta-cyclic-20e_nus-3d.py index 3aa6a4d7f8..dc0986f9bd 100644 --- a/configs/centerpoint/centerpoint_voxel0075_second_secfpn_head-dcn_8xb4-flip-tta-cyclic-20e_nus-3d.py +++ b/configs/centerpoint/centerpoint_voxel0075_second_secfpn_head-dcn_8xb4-flip-tta-cyclic-20e_nus-3d.py @@ -5,20 +5,26 @@ # Using calibration info convert the Lidar-coordinate point cloud range to the # ego-coordinate point cloud range could bring a little promotion in nuScenes. # point_cloud_range = [-54, -54.8, -5.0, 54, 53.2, 3.0] -file_client_args = dict(backend='disk') +backend_args = None class_names = [ 'car', 'truck', 'construction_vehicle', 'bus', 'trailer', 'barrier', 'motorcycle', 'bicycle', 'pedestrian', 'traffic_cone' ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=9, use_dim=[0, 1, 2, 3, 4], pad_empty_sweeps=True, - remove_close=True), + remove_close=True, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), diff --git a/configs/centerpoint/centerpoint_voxel0075_second_secfpn_head-dcn_8xb4-tta-cyclic-20e_nus-3d.py b/configs/centerpoint/centerpoint_voxel0075_second_secfpn_head-dcn_8xb4-tta-cyclic-20e_nus-3d.py index b26f655f9e..d65585d795 100644 --- a/configs/centerpoint/centerpoint_voxel0075_second_secfpn_head-dcn_8xb4-tta-cyclic-20e_nus-3d.py +++ b/configs/centerpoint/centerpoint_voxel0075_second_secfpn_head-dcn_8xb4-tta-cyclic-20e_nus-3d.py @@ -7,20 +7,26 @@ # Using calibration info convert the Lidar-coordinate point cloud range to the # ego-coordinate point cloud range could bring a little promotion in nuScenes. # point_cloud_range = [-54, -54.8, -5.0, 54, 53.2, 3.0] -file_client_args = dict(backend='disk') +backend_args = None class_names = [ 'car', 'truck', 'construction_vehicle', 'bus', 'trailer', 'barrier', 'motorcycle', 'bicycle', 'pedestrian', 'traffic_cone' ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=9, use_dim=[0, 1, 2, 3, 4], pad_empty_sweeps=True, - remove_close=True), + remove_close=True, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), diff --git a/configs/centerpoint/centerpoint_voxel01_second_secfpn_8xb4-cyclic-20e_nus-3d.py b/configs/centerpoint/centerpoint_voxel01_second_secfpn_8xb4-cyclic-20e_nus-3d.py index d531fe55dd..0a44c14d51 100644 --- a/configs/centerpoint/centerpoint_voxel01_second_secfpn_8xb4-cyclic-20e_nus-3d.py +++ b/configs/centerpoint/centerpoint_voxel01_second_secfpn_8xb4-cyclic-20e_nus-3d.py @@ -26,7 +26,7 @@ dataset_type = 'NuScenesDataset' data_root = 'data/nuscenes/' -file_client_args = dict(backend='disk') +backend_args = None db_sampler = dict( data_root=data_root, @@ -61,16 +61,24 @@ type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, - use_dim=[0, 1, 2, 3, 4])) + use_dim=[0, 1, 2, 3, 4], + backend_args=backend_args), + backend_args=backend_args) train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=9, use_dim=[0, 1, 2, 3, 4], pad_empty_sweeps=True, - remove_close=True), + remove_close=True, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict(type='ObjectSample', db_sampler=db_sampler), dict( @@ -92,13 +100,19 @@ keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=9, use_dim=[0, 1, 2, 3, 4], pad_empty_sweeps=True, - remove_close=True), + remove_close=True, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), @@ -136,7 +150,8 @@ use_valid_flag=True, # we use box_type_3d='LiDAR' in kitti and nuscenes dataset # and box_type_3d='Depth' in sunrgbd and scannet dataset. - box_type_3d='LiDAR'))) + box_type_3d='LiDAR', + backend_args=backend_args))) test_dataloader = dict( dataset=dict(pipeline=test_pipeline, metainfo=dict(classes=class_names))) val_dataloader = dict( diff --git a/configs/fcaf3d/fcaf3d_2xb8_scannet-3d-18class.py b/configs/fcaf3d/fcaf3d_2xb8_scannet-3d-18class.py index d6e21a3f5e..49a02970ac 100644 --- a/configs/fcaf3d/fcaf3d_2xb8_scannet-3d-18class.py +++ b/configs/fcaf3d/fcaf3d_2xb8_scannet-3d-18class.py @@ -3,6 +3,7 @@ '../_base_/datasets/scannet-3d.py' ] n_points = 100000 +backend_args = None train_pipeline = [ dict( @@ -11,7 +12,8 @@ shift_height=False, use_color=True, load_dim=6, - use_dim=[0, 1, 2, 3, 4, 5]), + use_dim=[0, 1, 2, 3, 4, 5], + backend_args=backend_args), dict(type='LoadAnnotations3D'), dict(type='GlobalAlignment', rotation_axis=2), dict(type='PointSample', num_points=n_points), @@ -38,7 +40,8 @@ shift_height=False, use_color=True, load_dim=6, - use_dim=[0, 1, 2, 3, 4, 5]), + use_dim=[0, 1, 2, 3, 4, 5], + backend_args=backend_args), dict(type='GlobalAlignment', rotation_axis=2), dict( type='MultiScaleFlipAug3D', diff --git a/configs/fcaf3d/fcaf3d_2xb8_sunrgbd-3d-10class.py b/configs/fcaf3d/fcaf3d_2xb8_sunrgbd-3d-10class.py index efe6806b64..3ebe7056b8 100644 --- a/configs/fcaf3d/fcaf3d_2xb8_sunrgbd-3d-10class.py +++ b/configs/fcaf3d/fcaf3d_2xb8_sunrgbd-3d-10class.py @@ -3,6 +3,7 @@ '../_base_/datasets/sunrgbd-3d.py' ] n_points = 100000 +backend_args = None model = dict( bbox_head=dict( @@ -16,7 +17,8 @@ coord_type='DEPTH', shift_height=False, load_dim=6, - use_dim=[0, 1, 2, 3, 4, 5]), + use_dim=[0, 1, 2, 3, 4, 5], + backend_args=backend_args), dict(type='LoadAnnotations3D'), dict(type='PointSample', num_points=n_points), dict(type='RandomFlip3D', sync_2d=False, flip_ratio_bev_horizontal=0.5), @@ -36,7 +38,8 @@ coord_type='DEPTH', shift_height=False, load_dim=6, - use_dim=[0, 1, 2, 3, 4, 5]), + use_dim=[0, 1, 2, 3, 4, 5], + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), diff --git a/configs/fcos3d/fcos3d_r101-caffe-dcn_fpn_head-gn_8xb2-1x_nus-mono3d.py b/configs/fcos3d/fcos3d_r101-caffe-dcn_fpn_head-gn_8xb2-1x_nus-mono3d.py index 0f81fa2e39..f7ba665cec 100644 --- a/configs/fcos3d/fcos3d_r101-caffe-dcn_fpn_head-gn_8xb2-1x_nus-mono3d.py +++ b/configs/fcos3d/fcos3d_r101-caffe-dcn_fpn_head-gn_8xb2-1x_nus-mono3d.py @@ -14,21 +14,10 @@ dcn=dict(type='DCNv2', deform_groups=1, fallback_on_stride=False), stage_with_dcn=(False, False, True, True))) -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( -# backend='petrel', -# path_mapping=dict({ -# './data/nuscenes/': -# 's3://openmmlab/datasets/detection3d/nuscenes/', -# 'data/nuscenes/': -# 's3://openmmlab/datasets/detection3d/nuscenes/' -# })) +backend_args = None train_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox=True, @@ -47,7 +36,7 @@ ]), ] test_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict(type='mmdet.Resize', scale_factor=1.0), dict(type='Pack3DDetInputs', keys=['img']) ] diff --git a/configs/free_anchor/pointpillars_hv_regnet-1.6gf_fpn_head-free-anchor_sbn-all_8xb4-strong-aug-3x_nus-3d.py b/configs/free_anchor/pointpillars_hv_regnet-1.6gf_fpn_head-free-anchor_sbn-all_8xb4-strong-aug-3x_nus-3d.py index c6cf884ac5..4d5a48507c 100644 --- a/configs/free_anchor/pointpillars_hv_regnet-1.6gf_fpn_head-free-anchor_sbn-all_8xb4-strong-aug-3x_nus-3d.py +++ b/configs/free_anchor/pointpillars_hv_regnet-1.6gf_fpn_head-free-anchor_sbn-all_8xb4-strong-aug-3x_nus-3d.py @@ -25,19 +25,19 @@ 'car', 'truck', 'trailer', 'bus', 'construction_vehicle', 'bicycle', 'motorcycle', 'pedestrian', 'traffic_cone', 'barrier' ] -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( -# backend='petrel', -# path_mapping=dict({ -# './data/nuscenes/': 's3://nuscenes/nuscenes/', -# 'data/nuscenes/': 's3://nuscenes/nuscenes/' -# })) +backend_args = None + train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), - dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), + dict( + type='LoadPointsFromMultiSweeps', + sweeps_num=10, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( type='GlobalRotScaleTrans', diff --git a/configs/free_anchor/pointpillars_hv_regnet-3.2gf_fpn_head-free-anchor_sbn-all_8xb4-strong-aug-3x_nus-3d.py b/configs/free_anchor/pointpillars_hv_regnet-3.2gf_fpn_head-free-anchor_sbn-all_8xb4-strong-aug-3x_nus-3d.py index 3126675f55..2e4e02f5e6 100644 --- a/configs/free_anchor/pointpillars_hv_regnet-3.2gf_fpn_head-free-anchor_sbn-all_8xb4-strong-aug-3x_nus-3d.py +++ b/configs/free_anchor/pointpillars_hv_regnet-3.2gf_fpn_head-free-anchor_sbn-all_8xb4-strong-aug-3x_nus-3d.py @@ -25,27 +25,19 @@ 'car', 'truck', 'trailer', 'bus', 'construction_vehicle', 'bicycle', 'motorcycle', 'pedestrian', 'traffic_cone', 'barrier' ] -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( -# backend='petrel', -# path_mapping=dict({ -# './data/nuscenes/': 's3://nuscenes/nuscenes/', -# 'data/nuscenes/': 's3://nuscenes/nuscenes/' -# })) +backend_args = None + train_pipeline = [ dict( type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=10, - file_client_args=file_client_args), + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( type='GlobalRotScaleTrans', diff --git a/configs/groupfree3d/groupfree3d_head-L12-O256_4xb8_scannet-seg.py b/configs/groupfree3d/groupfree3d_head-L12-O256_4xb8_scannet-seg.py index 4fd14f634f..f53b2bba9f 100644 --- a/configs/groupfree3d/groupfree3d_head-L12-O256_4xb8_scannet-seg.py +++ b/configs/groupfree3d/groupfree3d_head-L12-O256_4xb8_scannet-seg.py @@ -79,19 +79,22 @@ 'garbagebin') metainfo = dict(classes=class_names) +backend_args = None train_pipeline = [ dict( type='LoadPointsFromFile', coord_type='DEPTH', load_dim=6, - use_dim=[0, 1, 2]), + use_dim=[0, 1, 2], + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True, with_mask_3d=True, - with_seg_3d=True), + with_seg_3d=True, + backend_args=backend_args), dict(type='GlobalAlignment', rotation_axis=2), dict(type='PointSegClassMapping'), dict(type='PointSample', num_points=50000), @@ -116,7 +119,8 @@ type='LoadPointsFromFile', coord_type='DEPTH', load_dim=6, - use_dim=[0, 1, 2]), + use_dim=[0, 1, 2], + backend_args=backend_args), dict(type='GlobalAlignment', rotation_axis=2), dict( type='MultiScaleFlipAug3D', @@ -155,7 +159,8 @@ metainfo=metainfo, # we use box_type_3d='LiDAR' in kitti and nuscenes dataset # and box_type_3d='Depth' in sunrgbd and scannet dataset. - box_type_3d='Depth'))) + box_type_3d='Depth', + backend_args=backend_args))) val_dataloader = dict( batch_size=1, num_workers=1, @@ -167,7 +172,8 @@ pipeline=test_pipeline, metainfo=metainfo, test_mode=True, - box_type_3d='Depth')) + box_type_3d='Depth', + backend_args=backend_args)) test_dataloader = dict( batch_size=1, num_workers=1, @@ -179,7 +185,8 @@ pipeline=test_pipeline, metainfo=metainfo, test_mode=True, - box_type_3d='Depth')) + box_type_3d='Depth', + backend_args=backend_args)) val_evaluator = dict(type='IndoorMetric') test_evaluator = val_evaluator diff --git a/configs/groupfree3d/groupfree3d_head-L6-O256_4xb8_scannet-seg.py b/configs/groupfree3d/groupfree3d_head-L6-O256_4xb8_scannet-seg.py index 587080286c..fc1077799d 100644 --- a/configs/groupfree3d/groupfree3d_head-L6-O256_4xb8_scannet-seg.py +++ b/configs/groupfree3d/groupfree3d_head-L6-O256_4xb8_scannet-seg.py @@ -78,19 +78,22 @@ 'garbagebin') metainfo = dict(classes=class_names) +backend_args = None train_pipeline = [ dict( type='LoadPointsFromFile', coord_type='DEPTH', load_dim=6, - use_dim=[0, 1, 2]), + use_dim=[0, 1, 2], + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True, with_mask_3d=True, - with_seg_3d=True), + with_seg_3d=True, + backend_args=backend_args), dict(type='GlobalAlignment', rotation_axis=2), dict(type='PointSegClassMapping'), dict(type='PointSample', num_points=50000), @@ -115,7 +118,8 @@ type='LoadPointsFromFile', coord_type='DEPTH', load_dim=6, - use_dim=[0, 1, 2]), + use_dim=[0, 1, 2], + backend_args=backend_args), dict(type='GlobalAlignment', rotation_axis=2), dict( type='MultiScaleFlipAug3D', @@ -154,7 +158,8 @@ metainfo=metainfo, # we use box_type_3d='LiDAR' in kitti and nuscenes dataset # and box_type_3d='Depth' in sunrgbd and scannet dataset. - box_type_3d='Depth'))) + box_type_3d='Depth', + backend_args=backend_args))) val_dataloader = dict( batch_size=1, num_workers=1, @@ -166,7 +171,8 @@ pipeline=test_pipeline, metainfo=metainfo, test_mode=True, - box_type_3d='Depth')) + box_type_3d='Depth', + backend_args=backend_args)) test_dataloader = dict( batch_size=1, num_workers=1, @@ -178,7 +184,8 @@ pipeline=test_pipeline, metainfo=metainfo, test_mode=True, - box_type_3d='Depth')) + box_type_3d='Depth', + backend_args=backend_args)) val_evaluator = dict(type='IndoorMetric') test_evaluator = val_evaluator diff --git a/configs/groupfree3d/groupfree3d_w2x-head-L12-O256_4xb8_scannet-seg.py b/configs/groupfree3d/groupfree3d_w2x-head-L12-O256_4xb8_scannet-seg.py index 9099c04cd5..52fb7de735 100644 --- a/configs/groupfree3d/groupfree3d_w2x-head-L12-O256_4xb8_scannet-seg.py +++ b/configs/groupfree3d/groupfree3d_w2x-head-L12-O256_4xb8_scannet-seg.py @@ -94,19 +94,22 @@ 'garbagebin') metainfo = dict(classes=class_names) +backend_args = None train_pipeline = [ dict( type='LoadPointsFromFile', coord_type='DEPTH', load_dim=6, - use_dim=[0, 1, 2]), + use_dim=[0, 1, 2], + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True, with_mask_3d=True, - with_seg_3d=True), + with_seg_3d=True, + backend_args=backend_args), dict(type='GlobalAlignment', rotation_axis=2), dict(type='PointSegClassMapping'), dict(type='PointSample', num_points=50000), @@ -131,7 +134,8 @@ type='LoadPointsFromFile', coord_type='DEPTH', load_dim=6, - use_dim=[0, 1, 2]), + use_dim=[0, 1, 2], + backend_args=backend_args), dict(type='GlobalAlignment', rotation_axis=2), dict( type='MultiScaleFlipAug3D', @@ -170,7 +174,8 @@ metainfo=metainfo, # we use box_type_3d='LiDAR' in kitti and nuscenes dataset # and box_type_3d='Depth' in sunrgbd and scannet dataset. - box_type_3d='Depth'))) + box_type_3d='Depth', + backend_args=backend_args))) val_dataloader = dict( batch_size=1, num_workers=1, @@ -182,7 +187,8 @@ pipeline=test_pipeline, metainfo=metainfo, test_mode=True, - box_type_3d='Depth')) + box_type_3d='Depth', + backend_args=backend_args)) test_dataloader = dict( batch_size=1, num_workers=1, @@ -194,7 +200,8 @@ pipeline=test_pipeline, metainfo=metainfo, test_mode=True, - box_type_3d='Depth')) + box_type_3d='Depth', + backend_args=backend_args)) val_evaluator = dict(type='IndoorMetric') test_evaluator = val_evaluator diff --git a/configs/groupfree3d/groupfree3d_w2x-head-L12-O512_4xb8_scannet-seg.py b/configs/groupfree3d/groupfree3d_w2x-head-L12-O512_4xb8_scannet-seg.py index fc6398c19c..c24aa1a9f3 100644 --- a/configs/groupfree3d/groupfree3d_w2x-head-L12-O512_4xb8_scannet-seg.py +++ b/configs/groupfree3d/groupfree3d_w2x-head-L12-O512_4xb8_scannet-seg.py @@ -95,19 +95,22 @@ 'garbagebin') metainfo = dict(classes=class_names) +backend_args = None train_pipeline = [ dict( type='LoadPointsFromFile', coord_type='DEPTH', load_dim=6, - use_dim=[0, 1, 2]), + use_dim=[0, 1, 2], + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True, with_mask_3d=True, - with_seg_3d=True), + with_seg_3d=True, + backend_args=backend_args), dict(type='GlobalAlignment', rotation_axis=2), dict(type='PointSegClassMapping'), dict(type='PointSample', num_points=50000), @@ -132,7 +135,8 @@ type='LoadPointsFromFile', coord_type='DEPTH', load_dim=6, - use_dim=[0, 1, 2]), + use_dim=[0, 1, 2], + backend_args=backend_args), dict(type='GlobalAlignment', rotation_axis=2), dict( type='MultiScaleFlipAug3D', @@ -171,7 +175,8 @@ metainfo=metainfo, # we use box_type_3d='LiDAR' in kitti and nuscenes dataset # and box_type_3d='Depth' in sunrgbd and scannet dataset. - box_type_3d='Depth'))) + box_type_3d='Depth', + backend_args=backend_args))) val_dataloader = dict( batch_size=1, num_workers=1, @@ -183,7 +188,8 @@ pipeline=test_pipeline, metainfo=metainfo, test_mode=True, - box_type_3d='Depth')) + box_type_3d='Depth', + backend_args=backend_args)) test_dataloader = dict( batch_size=1, num_workers=1, @@ -195,7 +201,8 @@ pipeline=test_pipeline, metainfo=metainfo, test_mode=True, - box_type_3d='Depth')) + box_type_3d='Depth', + backend_args=backend_args)) val_evaluator = dict(type='IndoorMetric') test_evaluator = val_evaluator diff --git a/configs/imvotenet/imvotenet_faster-rcnn-r50_fpn_4xb2_sunrgbd-3d.py b/configs/imvotenet/imvotenet_faster-rcnn-r50_fpn_4xb2_sunrgbd-3d.py index a1b290638f..ee3369cf8e 100644 --- a/configs/imvotenet/imvotenet_faster-rcnn-r50_fpn_4xb2_sunrgbd-3d.py +++ b/configs/imvotenet/imvotenet_faster-rcnn-r50_fpn_4xb2_sunrgbd-3d.py @@ -3,8 +3,10 @@ '../_base_/models/imvotenet.py' ] +backend_args = None + train_pipeline = [ - dict(type='LoadImageFromFile'), + dict(type='LoadImageFromFile', backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox=True, @@ -22,7 +24,7 @@ ] test_pipeline = [ - dict(type='LoadImageFromFile'), + dict(type='LoadImageFromFile', backend_args=backend_args), # online evaluation dict( type='LoadAnnotations3D', diff --git a/configs/imvotenet/imvotenet_stage2_8xb16_sunrgbd-3d.py b/configs/imvotenet/imvotenet_stage2_8xb16_sunrgbd-3d.py index 2dd7e80733..5d52179658 100644 --- a/configs/imvotenet/imvotenet_stage2_8xb16_sunrgbd-3d.py +++ b/configs/imvotenet/imvotenet_stage2_8xb16_sunrgbd-3d.py @@ -5,6 +5,7 @@ class_names = ('bed', 'table', 'sofa', 'chair', 'toilet', 'desk', 'dresser', 'night_stand', 'bookshelf', 'bathtub') +backend_args = None model = dict( pts_backbone=dict( @@ -170,8 +171,9 @@ coord_type='DEPTH', shift_height=True, load_dim=6, - use_dim=[0, 1, 2]), - dict(type='LoadImageFromFile'), + use_dim=[0, 1, 2], + backend_args=backend_args), + dict(type='LoadImageFromFile', backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox=True, @@ -198,13 +200,14 @@ ])) ] test_pipeline = [ - dict(type='LoadImageFromFile'), + dict(type='LoadImageFromFile', backend_args=backend_args), dict( type='LoadPointsFromFile', coord_type='DEPTH', shift_height=True, load_dim=6, - use_dim=[0, 1, 2]), + use_dim=[0, 1, 2], + backend_args=backend_args), dict(type='Resize', scale=(1333, 600), keep_ratio=True), dict(type='PointSample', num_points=20000), dict(type='Pack3DDetInputs', keys=['img', 'points']) diff --git a/configs/imvoxelnet/imvoxelnet_2xb4_sunrgbd-3d-10class.py b/configs/imvoxelnet/imvoxelnet_2xb4_sunrgbd-3d-10class.py index 4ab04ff934..2884f92182 100644 --- a/configs/imvoxelnet/imvoxelnet_2xb4_sunrgbd-3d-10class.py +++ b/configs/imvoxelnet/imvoxelnet_2xb4_sunrgbd-3d-10class.py @@ -56,28 +56,17 @@ ] metainfo = dict(CLASSES=class_names) -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( -# backend='petrel', -# path_mapping=dict({ -# './data/sunrgbd/': -# 's3://openmmlab/datasets/detection3d/sunrgbd_processed/', -# 'data/sunrgbd/': -# 's3://openmmlab/datasets/detection3d/sunrgbd_processed/' -# })) +backend_args = None train_pipeline = [ - dict(type='LoadAnnotations3D'), - dict(type='LoadImageFromFile', file_client_args=file_client_args), + dict(type='LoadAnnotations3D', backend_args=backend_args), + dict(type='LoadImageFromFile', backend_args=backend_args), dict(type='RandomResize', scale=[(512, 384), (768, 576)], keep_ratio=True), dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5), dict(type='Pack3DDetInputs', keys=['img', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadImageFromFile', file_client_args=file_client_args), + dict(type='LoadImageFromFile', backend_args=backend_args), dict(type='Resize', scale=(640, 480), keep_ratio=True), dict(type='Pack3DDetInputs', keys=['img']) ] @@ -98,7 +87,8 @@ test_mode=False, filter_empty_gt=True, box_type_3d='Depth', - metainfo=metainfo))) + metainfo=metainfo, + backend_args=backend_args))) val_dataloader = dict( batch_size=1, num_workers=1, @@ -112,7 +102,8 @@ pipeline=test_pipeline, test_mode=True, box_type_3d='Depth', - metainfo=metainfo)) + metainfo=metainfo, + backend_args=backend_args)) test_dataloader = val_dataloader val_evaluator = dict( diff --git a/configs/imvoxelnet/imvoxelnet_8xb4_kitti-3d-car.py b/configs/imvoxelnet/imvoxelnet_8xb4_kitti-3d-car.py index 34e0ddef7f..49b6eeb732 100644 --- a/configs/imvoxelnet/imvoxelnet_8xb4_kitti-3d-car.py +++ b/configs/imvoxelnet/imvoxelnet_8xb4_kitti-3d-car.py @@ -84,22 +84,11 @@ point_cloud_range = [0, -39.68, -3, 69.12, 39.68, 1] metainfo = dict(classes=class_names) -# file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -file_client_args = dict( - backend='petrel', - path_mapping=dict({ - './data/kitti/': - 's3://openmmlab/datasets/detection3d/kitti/', - 'data/kitti/': - 's3://openmmlab/datasets/detection3d/kitti/' - })) +backend_args = None train_pipeline = [ - dict(type='LoadAnnotations3D'), - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadAnnotations3D', backend_args=backend_args), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5), dict( type='RandomResize', scale=[(1173, 352), (1387, 416)], @@ -108,7 +97,7 @@ dict(type='Pack3DDetInputs', keys=['img', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict(type='Resize', scale=(1280, 384), keep_ratio=True), dict(type='Pack3DDetInputs', keys=['img']) ] @@ -129,7 +118,8 @@ pipeline=train_pipeline, modality=input_modality, test_mode=False, - metainfo=metainfo))) + metainfo=metainfo, + backend_args=backend_args))) val_dataloader = dict( batch_size=1, num_workers=1, @@ -144,13 +134,15 @@ pipeline=test_pipeline, modality=input_modality, test_mode=True, - metainfo=metainfo)) + metainfo=metainfo, + backend_args=backend_args)) test_dataloader = val_dataloader val_evaluator = dict( type='KittiMetric', ann_file=data_root + 'kitti_infos_val.pkl', - metric='bbox') + metric='bbox', + backend_args=backend_args) test_evaluator = val_evaluator # optimizer diff --git a/configs/mvxnet/mvxnet_fpn_dv_second_secfpn_8xb2-80e_kitti-3d-3class.py b/configs/mvxnet/mvxnet_fpn_dv_second_secfpn_8xb2-80e_kitti-3d-3class.py index f031359efb..ea2be54dd6 100644 --- a/configs/mvxnet/mvxnet_fpn_dv_second_secfpn_8xb2-80e_kitti-3d-3class.py +++ b/configs/mvxnet/mvxnet_fpn_dv_second_secfpn_8xb2-80e_kitti-3d-3class.py @@ -144,9 +144,15 @@ class_names = ['Pedestrian', 'Cyclist', 'Car'] metainfo = dict(classes=class_names) input_modality = dict(use_lidar=True, use_camera=True) +backend_args = None train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), - dict(type='LoadImageFromFile'), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), + dict(type='LoadImageFromFile', backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( type='RandomResize', scale=[(640, 192), (2560, 768)], keep_ratio=True), @@ -167,8 +173,13 @@ ]) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), - dict(type='LoadImageFromFile'), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), + dict(type='LoadImageFromFile', backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1280, 384), @@ -208,7 +219,8 @@ metainfo=metainfo, # we use box_type_3d='LiDAR' in kitti and nuscenes dataset # and box_type_3d='Depth' in sunrgbd and scannet dataset. - box_type_3d='LiDAR'))) + box_type_3d='LiDAR', + backend_args=backend_args))) val_dataloader = dict( batch_size=1, @@ -224,7 +236,8 @@ pipeline=test_pipeline, metainfo=metainfo, test_mode=True, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) test_dataloader = dict( batch_size=1, num_workers=1, @@ -239,7 +252,8 @@ pipeline=test_pipeline, metainfo=metainfo, test_mode=True, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) optim_wrapper = dict( optimizer=dict(weight_decay=0.01), diff --git a/configs/nuimages/htc_r50_fpn_1x_nuim.py b/configs/nuimages/htc_r50_fpn_1x_nuim.py index da110cc5e5..4b1bcc298b 100644 --- a/configs/nuimages/htc_r50_fpn_1x_nuim.py +++ b/configs/nuimages/htc_r50_fpn_1x_nuim.py @@ -18,8 +18,9 @@ loss_weight=0.2))) data_root = 'data/nuimages/' +backend_args = None train_pipeline = [ - dict(type='LoadImageFromFile'), + dict(type='LoadImageFromFile', backend_args=backend_args), dict( type='LoadAnnotations', with_bbox=True, with_mask=True, with_seg=True), dict( diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py index d875742579..9d67f14346 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py @@ -8,8 +8,9 @@ backbone=dict(norm_cfg=dict(requires_grad=False), style='caffe'), roi_head=dict( bbox_head=dict(num_classes=10), mask_head=dict(num_classes=10))) +backend_args = None train_pipeline = [ - dict(type='LoadImageFromFile'), + dict(type='LoadImageFromFile', backend_args=backend_args), dict(type='LoadAnnotations', with_bbox=True, with_mask=True), dict( type='Resize', @@ -20,7 +21,7 @@ dict(type='PackDetInputs'), ] test_pipeline = [ - dict(type='LoadImageFromFile'), + dict(type='LoadImageFromFile', backend_args=backend_args), dict( type='MultiScaleFlipAug', img_scale=(1600, 900), diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py index d8466ae500..1be657cf64 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py @@ -8,8 +8,9 @@ backbone=dict(norm_cfg=dict(requires_grad=False), style='caffe'), roi_head=dict( bbox_head=dict(num_classes=10), mask_head=dict(num_classes=10))) +backend_args = None train_pipeline = [ - dict(type='LoadImageFromFile'), + dict(type='LoadImageFromFile', backend_args=backend_args), dict(type='LoadAnnotations', with_bbox=True, with_mask=True), dict( type='Resize', @@ -20,7 +21,7 @@ dict(type='PackDetInputs'), ] test_pipeline = [ - dict(type='LoadImageFromFile'), + dict(type='LoadImageFromFile', backend_args=backend_args), dict( type='MultiScaleFlipAug', img_scale=(1600, 900), diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py index c29f5b50e0..c41d6980a7 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py @@ -8,8 +8,9 @@ backbone=dict(norm_cfg=dict(requires_grad=False), style='caffe'), roi_head=dict( bbox_head=dict(num_classes=10), mask_head=dict(num_classes=10))) +backend_args = None train_pipeline = [ - dict(type='LoadImageFromFile'), + dict(type='LoadImageFromFile', backend_args=backend_args), dict(type='LoadAnnotations', with_bbox=True, with_mask=True), dict( type='Resize', @@ -20,7 +21,7 @@ dict(type='PackDetInputs'), ] test_pipeline = [ - dict(type='LoadImageFromFile'), + dict(type='LoadImageFromFile', backend_args=backend_args), dict( type='MultiScaleFlipAug', img_scale=(1600, 900), diff --git a/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py b/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py index 1177ab6dcd..c2279e41d8 100644 --- a/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py +++ b/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py @@ -7,15 +7,10 @@ roi_head=dict( bbox_head=dict(num_classes=10), mask_head=dict(num_classes=10))) -file_client_args = dict( - backend='petrel', - path_mapping=dict({ - './data/nuscenes/': 's3://nuscenes/nuscenes/', - 'data/nuscenes/': 's3://nuscenes/nuscenes/' - })) +backend_args = None test_pipeline = [ - dict(type='LoadImageFromFile'), + dict(type='LoadImageFromFile', backend_args=backend_args), dict( type='MultiScaleFlipAug', img_scale=(1600, 900), diff --git a/configs/paconv/paconv_ssg-cuda_8xb8-cosine-200e_s3dis-seg.py b/configs/paconv/paconv_ssg-cuda_8xb8-cosine-200e_s3dis-seg.py index 1f61865da3..e9b8cdc1b3 100644 --- a/configs/paconv/paconv_ssg-cuda_8xb8-cosine-200e_s3dis-seg.py +++ b/configs/paconv/paconv_ssg-cuda_8xb8-cosine-200e_s3dis-seg.py @@ -17,6 +17,7 @@ # data settings num_points = 4096 +backend_args = None train_pipeline = [ dict( type='LoadPointsFromFile', @@ -24,13 +25,15 @@ shift_height=False, use_color=True, load_dim=6, - use_dim=[0, 1, 2, 3, 4, 5]), + use_dim=[0, 1, 2, 3, 4, 5], + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=False, with_label_3d=False, with_mask_3d=False, - with_seg_3d=True), + with_seg_3d=True, + backend_args=backend_args), dict(type='PointSegClassMapping'), dict( type='IndoorPatchPointSample', diff --git a/configs/paconv/paconv_ssg_8xb8-cosine-150e_s3dis-seg.py b/configs/paconv/paconv_ssg_8xb8-cosine-150e_s3dis-seg.py index 2ce7d3a647..da29b89483 100644 --- a/configs/paconv/paconv_ssg_8xb8-cosine-150e_s3dis-seg.py +++ b/configs/paconv/paconv_ssg_8xb8-cosine-150e_s3dis-seg.py @@ -17,6 +17,7 @@ # data settings num_points = 4096 +backend_args = None train_pipeline = [ dict( type='LoadPointsFromFile', @@ -24,13 +25,15 @@ shift_height=False, use_color=True, load_dim=6, - use_dim=[0, 1, 2, 3, 4, 5]), + use_dim=[0, 1, 2, 3, 4, 5], + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=False, with_label_3d=False, with_mask_3d=False, - with_seg_3d=True), + with_seg_3d=True, + backend_args=backend_args), dict(type='PointSegClassMapping'), dict( type='IndoorPatchPointSample', diff --git a/configs/parta2/parta2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-3class.py b/configs/parta2/parta2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-3class.py index 656d925bd5..f22e133b7b 100644 --- a/configs/parta2/parta2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-3class.py +++ b/configs/parta2/parta2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-3class.py @@ -10,6 +10,7 @@ data_root = 'data/kitti/' class_names = ['Pedestrian', 'Cyclist', 'Car'] input_modality = dict(use_lidar=True, use_camera=False) +backend_args = None db_sampler = dict( data_root=data_root, info_path=data_root + 'kitti_dbinfos_train.pkl', @@ -20,9 +21,19 @@ classes=class_names, sample_groups=dict(Car=12, Pedestrian=6, Cyclist=6), points_loader=dict( - type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4)) + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), + backend_args=backend_args) train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict(type='ObjectSample', db_sampler=db_sampler), dict( @@ -45,7 +56,12 @@ keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), @@ -66,7 +82,12 @@ # construct a pipeline for data and gt loading in show function # please keep its loading function consistent with test_pipeline (e.g. client) eval_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict(type='Pack3DDetInputs', keys=['points']) ] train_dataloader = dict( @@ -86,7 +107,8 @@ modality=input_modality, metainfo=dict(classes=class_names), box_type_3d='LiDAR', - test_mode=False))) + test_mode=False, + backend_args=backend_args))) test_dataloader = dict( batch_size=1, num_workers=1, @@ -102,7 +124,8 @@ modality=input_modality, metainfo=dict(classes=class_names), box_type_3d='LiDAR', - test_mode=True)) + test_mode=True, + backend_args=backend_args)) val_dataloader = dict( batch_size=1, num_workers=1, @@ -118,11 +141,13 @@ modality=input_modality, metainfo=dict(classes=class_names), box_type_3d='LiDAR', - test_mode=True)) + test_mode=True, + backend_args=backend_args)) val_evaluator = dict( type='KittiMetric', ann_file=data_root + 'kitti_infos_val.pkl', - metric='bbox') + metric='bbox', + backend_args=backend_args) test_evaluator = val_evaluator # Part-A2 uses a different learning rate from what SECOND uses. optim_wrapper = dict(optimizer=dict(lr=0.001)) diff --git a/configs/parta2/parta2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-car.py b/configs/parta2/parta2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-car.py index c1dee7c767..239cd0c6db 100644 --- a/configs/parta2/parta2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-car.py +++ b/configs/parta2/parta2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-car.py @@ -76,6 +76,7 @@ data_root = 'data/kitti/' class_names = ['Car'] input_modality = dict(use_lidar=True, use_camera=False) +backend_args = None db_sampler = dict( data_root=data_root, info_path=data_root + 'kitti_dbinfos_train.pkl', @@ -84,9 +85,19 @@ classes=class_names, sample_groups=dict(Car=15), points_loader=dict( - type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4)) + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), + backend_args=backend_args) train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict(type='ObjectSample', db_sampler=db_sampler), dict( @@ -109,7 +120,12 @@ keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), diff --git a/configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py b/configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py index acbcaa7b20..c7709d3b67 100644 --- a/configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py +++ b/configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py @@ -46,8 +46,10 @@ ]), test_cfg=dict(nms_pre=1000, nms_thr=0.8, score_thr=0.01, max_per_img=200)) +backend_args = None + train_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox=True, @@ -66,7 +68,7 @@ ]), ] test_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict(type='mmdet.Resize', scale_factor=1.0), dict(type='Pack3DDetInputs', keys=['img']), ] diff --git a/configs/pgd/pgd_r101-caffe_fpn_head-gn_4xb3-4x_kitti-mono3d.py b/configs/pgd/pgd_r101-caffe_fpn_head-gn_4xb3-4x_kitti-mono3d.py index d7de4727f5..2f83134e87 100644 --- a/configs/pgd/pgd_r101-caffe_fpn_head-gn_4xb3-4x_kitti-mono3d.py +++ b/configs/pgd/pgd_r101-caffe_fpn_head-gn_4xb3-4x_kitti-mono3d.py @@ -68,21 +68,10 @@ ]), test_cfg=dict(nms_pre=100, nms_thr=0.05, score_thr=0.001, max_per_img=20)) -file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -# file_client_args = dict( -# backend='petrel', -# path_mapping=dict({ -# './data/kitti/': -# 's3://openmmlab/datasets/detection3d/kitti/', -# 'data/kitti/': -# 's3://openmmlab/datasets/detection3d/kitti/' -# })) +backend_args = None train_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox=True, @@ -101,7 +90,7 @@ ]), ] test_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict(type='mmdet.Resize', scale_factor=1.0), dict(type='Pack3DDetInputs', keys=['img']) ] diff --git a/configs/point_rcnn/point-rcnn_8xb2_kitti-3d-3class.py b/configs/point_rcnn/point-rcnn_8xb2_kitti-3d-3class.py index eb8ae3e729..1826198cd7 100644 --- a/configs/point_rcnn/point-rcnn_8xb2_kitti-3d-3class.py +++ b/configs/point_rcnn/point-rcnn_8xb2_kitti-3d-3class.py @@ -10,6 +10,7 @@ metainfo = dict(classes=class_names) point_cloud_range = [0, -40, -3, 70.4, 40, 1] input_modality = dict(use_lidar=True, use_camera=False) +backend_args = None db_sampler = dict( data_root=data_root, @@ -21,10 +22,20 @@ sample_groups=dict(Car=20, Pedestrian=15, Cyclist=15), classes=class_names, points_loader=dict( - type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4)) + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), + backend_args=backend_args) train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict(type='PointsRangeFilter', point_cloud_range=point_cloud_range), dict(type='ObjectRangeFilter', point_cloud_range=point_cloud_range), @@ -48,7 +59,12 @@ keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), diff --git a/configs/pointnet2/pointnet2_msg_2xb16-cosine-250e_scannet-seg-xyz-only.py b/configs/pointnet2/pointnet2_msg_2xb16-cosine-250e_scannet-seg-xyz-only.py index a27ee5623b..b0b793f316 100644 --- a/configs/pointnet2/pointnet2_msg_2xb16-cosine-250e_scannet-seg-xyz-only.py +++ b/configs/pointnet2/pointnet2_msg_2xb16-cosine-250e_scannet-seg-xyz-only.py @@ -34,6 +34,7 @@ 'curtain', 'refrigerator', 'showercurtrain', 'toilet', 'sink', 'bathtub', 'otherfurniture') num_points = 8192 +backend_args = None train_pipeline = [ dict( type='LoadPointsFromFile', @@ -41,13 +42,15 @@ shift_height=False, use_color=False, load_dim=6, - use_dim=[0, 1, 2]), # only load xyz coordinates + use_dim=[0, 1, 2], # only load xyz coordinates + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=False, with_label_3d=False, with_mask_3d=False, - with_seg_3d=True), + with_seg_3d=True, + backend_args=backend_args), dict(type='PointSegClassMapping'), dict( type='IndoorPatchPointSample', @@ -66,13 +69,15 @@ shift_height=False, use_color=False, load_dim=6, - use_dim=[0, 1, 2]), + use_dim=[0, 1, 2], + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=False, with_label_3d=False, with_mask_3d=False, - with_seg_3d=True), + with_seg_3d=True, + backend_args=backend_args), dict( # a wrapper in order to successfully call test function # actually we don't perform test-time-aug diff --git a/configs/pointnet2/pointnet2_ssg_2xb16-cosine-200e_scannet-seg-xyz-only.py b/configs/pointnet2/pointnet2_ssg_2xb16-cosine-200e_scannet-seg-xyz-only.py index 66e7410f7a..a8d4421f18 100644 --- a/configs/pointnet2/pointnet2_ssg_2xb16-cosine-200e_scannet-seg-xyz-only.py +++ b/configs/pointnet2/pointnet2_ssg_2xb16-cosine-200e_scannet-seg-xyz-only.py @@ -34,6 +34,7 @@ 'curtain', 'refrigerator', 'showercurtrain', 'toilet', 'sink', 'bathtub', 'otherfurniture') num_points = 8192 +backend_args = None train_pipeline = [ dict( type='LoadPointsFromFile', @@ -41,13 +42,15 @@ shift_height=False, use_color=False, load_dim=6, - use_dim=[0, 1, 2]), # only load xyz coordinates + use_dim=[0, 1, 2], # only load xyz coordinates + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=False, with_label_3d=False, with_mask_3d=False, - with_seg_3d=True), + with_seg_3d=True, + backend_args=backend_args), dict(type='PointSegClassMapping'), dict( type='IndoorPatchPointSample', @@ -66,13 +69,15 @@ shift_height=False, use_color=False, load_dim=6, - use_dim=[0, 1, 2]), + use_dim=[0, 1, 2], + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=False, with_label_3d=False, with_mask_3d=False, - with_seg_3d=True), + with_seg_3d=True, + backend_args=backend_args), dict( # a wrapper in order to successfully call test function # actually we don't perform test-time-aug diff --git a/configs/pointpillars/pointpillars_hv_secfpn_8xb6-160e_kitti-3d-3class.py b/configs/pointpillars/pointpillars_hv_secfpn_8xb6-160e_kitti-3d-3class.py index 32d8c8e329..65786abb5e 100644 --- a/configs/pointpillars/pointpillars_hv_secfpn_8xb6-160e_kitti-3d-3class.py +++ b/configs/pointpillars/pointpillars_hv_secfpn_8xb6-160e_kitti-3d-3class.py @@ -9,6 +9,7 @@ data_root = 'data/kitti/' class_names = ['Pedestrian', 'Cyclist', 'Car'] metainfo = dict(classes=class_names) +backend_args = None # PointPillars adopted a different sampling strategies among classes db_sampler = dict( @@ -21,11 +22,21 @@ classes=class_names, sample_groups=dict(Car=15, Pedestrian=15, Cyclist=15), points_loader=dict( - type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4)) + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), + backend_args=backend_args) # PointPillars uses different augmentation hyper parameters train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict(type='ObjectSample', db_sampler=db_sampler, use_ground_plane=True), dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5), @@ -41,7 +52,12 @@ keys=['points', 'gt_labels_3d', 'gt_bboxes_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), diff --git a/configs/pointpillars/pointpillars_hv_secfpn_8xb6-160e_kitti-3d-car.py b/configs/pointpillars/pointpillars_hv_secfpn_8xb6-160e_kitti-3d-car.py index 94a38ad1c5..0ffd46ce51 100644 --- a/configs/pointpillars/pointpillars_hv_secfpn_8xb6-160e_kitti-3d-car.py +++ b/configs/pointpillars/pointpillars_hv_secfpn_8xb6-160e_kitti-3d-car.py @@ -5,6 +5,7 @@ data_root = 'data/kitti/' class_names = ['Car'] metainfo = dict(classes=class_names) +backend_args = None point_cloud_range = [0, -39.68, -3, 69.12, 39.68, 1] @@ -41,10 +42,20 @@ classes=class_names, sample_groups=dict(Car=15), points_loader=dict( - type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4)) + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), + backend_args=backend_args) train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict(type='ObjectSample', db_sampler=db_sampler, use_ground_plane=True), dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5), @@ -60,7 +71,12 @@ keys=['points', 'gt_labels_3d', 'gt_bboxes_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), diff --git a/configs/pv_rcnn/pv_rcnn_8xb2-80e_kitti-3d-3class.py b/configs/pv_rcnn/pv_rcnn_8xb2-80e_kitti-3d-3class.py index f3cb143954..f894c9aaca 100644 --- a/configs/pv_rcnn/pv_rcnn_8xb2-80e_kitti-3d-3class.py +++ b/configs/pv_rcnn/pv_rcnn_8xb2-80e_kitti-3d-3class.py @@ -9,6 +9,7 @@ data_root = 'data/kitti/' class_names = ['Pedestrian', 'Cyclist', 'Car'] metainfo = dict(CLASSES=class_names) +backend_args = None db_sampler = dict( data_root=data_root, info_path=data_root + 'kitti_dbinfos_train.pkl', @@ -19,10 +20,20 @@ classes=class_names, sample_groups=dict(Car=15, Pedestrian=10, Cyclist=10), points_loader=dict( - type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4)) + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), + backend_args=backend_args) train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict(type='ObjectSample', db_sampler=db_sampler, use_ground_plane=True), dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5), @@ -38,7 +49,12 @@ keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=4, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), diff --git a/configs/second/second_hv_secfpn_sbn-all_16xb2-2x_waymoD5-3d-3class.py b/configs/second/second_hv_secfpn_sbn-all_16xb2-2x_waymoD5-3d-3class.py index 4cab5a5ec4..3f313021f7 100644 --- a/configs/second/second_hv_secfpn_sbn-all_16xb2-2x_waymoD5-3d-3class.py +++ b/configs/second/second_hv_secfpn_sbn-all_16xb2-2x_waymoD5-3d-3class.py @@ -12,14 +12,7 @@ point_cloud_range = [-76.8, -51.2, -2, 76.8, 51.2, 4] input_modality = dict(use_lidar=True, use_camera=False) -file_client_args = dict( - backend='petrel', - path_mapping=dict({ - './data/waymo/': - 's3://openmmlab/datasets/detection3d/waymo/', - 'data/waymo/': - 's3://openmmlab/datasets/detection3d/waymo/' - })) +backend_args = None db_sampler = dict( data_root=data_root, @@ -34,7 +27,9 @@ type='LoadPointsFromFile', coord_type='LIDAR', load_dim=6, - use_dim=[0, 1, 2, 3, 4])) + use_dim=[0, 1, 2, 3, 4], + backend_args=backend_args), + backend_args=backend_args) train_pipeline = [ dict( @@ -42,7 +37,7 @@ coord_type='LIDAR', load_dim=6, use_dim=5, - file_client_args=file_client_args), + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), # dict(type='ObjectSample', db_sampler=db_sampler), dict( @@ -68,7 +63,7 @@ coord_type='LIDAR', load_dim=6, use_dim=5, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), @@ -107,7 +102,8 @@ # and box_type_3d='Depth' in sunrgbd and scannet dataset. box_type_3d='LiDAR', # load one frame every five frames - load_interval=5))) + load_interval=5, + backend_args=backend_args))) val_dataloader = dict( batch_size=1, num_workers=1, @@ -123,7 +119,8 @@ modality=input_modality, test_mode=True, metainfo=metainfo, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) test_dataloader = dict( batch_size=1, num_workers=1, @@ -139,7 +136,8 @@ modality=input_modality, test_mode=True, metainfo=metainfo, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) # Default setting for scaling LR automatically # - `enable` means enable scaling LR automatically # or not by default. diff --git a/configs/smoke/smoke_dla34_dlaneck_gn-all_4xb8-6x_kitti-mono3d.py b/configs/smoke/smoke_dla34_dlaneck_gn-all_4xb8-6x_kitti-mono3d.py index 6927e82838..8ca6b44394 100644 --- a/configs/smoke/smoke_dla34_dlaneck_gn-all_4xb8-6x_kitti-mono3d.py +++ b/configs/smoke/smoke_dla34_dlaneck_gn-all_4xb8-6x_kitti-mono3d.py @@ -3,21 +3,10 @@ '../_base_/default_runtime.py' ] -# file_client_args = dict(backend='disk') -# Uncomment the following if use ceph or other file clients. -# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient -# for more details. -file_client_args = dict( - backend='petrel', - path_mapping=dict({ - './data/kitti/': - 's3://openmmlab/datasets/detection3d/kitti/', - 'data/kitti/': - 's3://openmmlab/datasets/detection3d/kitti/' - })) +backend_args = None train_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox=True, @@ -37,7 +26,7 @@ ]), ] test_pipeline = [ - dict(type='LoadImageFromFileMono3D'), + dict(type='LoadImageFromFileMono3D', backend_args=backend_args), dict(type='AffineResize', img_scale=(1280, 384), down_ratio=4), dict(type='Pack3DDetInputs', keys=['img']) ] diff --git a/configs/ssn/ssn_hv_secfpn_sbn-all_16xb2-2x_lyft-3d.py b/configs/ssn/ssn_hv_secfpn_sbn-all_16xb2-2x_lyft-3d.py index 3451eb906b..cb3a5d41b5 100644 --- a/configs/ssn/ssn_hv_secfpn_sbn-all_16xb2-2x_lyft-3d.py +++ b/configs/ssn/ssn_hv_secfpn_sbn-all_16xb2-2x_lyft-3d.py @@ -11,10 +11,19 @@ 'bicycle', 'motorcycle', 'pedestrian', 'animal', 'car', 'emergency_vehicle', 'bus', 'other_vehicle', 'truck' ] +backend_args = None train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), - dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), + dict( + type='LoadPointsFromMultiSweeps', + sweeps_num=10, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( type='GlobalRotScaleTrans', @@ -34,8 +43,16 @@ keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), - dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), + dict( + type='LoadPointsFromMultiSweeps', + sweeps_num=10, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), diff --git a/configs/ssn/ssn_hv_secfpn_sbn-all_16xb2-2x_nus-3d.py b/configs/ssn/ssn_hv_secfpn_sbn-all_16xb2-2x_nus-3d.py index 7a679acc52..8d5e67fa44 100644 --- a/configs/ssn/ssn_hv_secfpn_sbn-all_16xb2-2x_nus-3d.py +++ b/configs/ssn/ssn_hv_secfpn_sbn-all_16xb2-2x_nus-3d.py @@ -11,10 +11,19 @@ 'bicycle', 'motorcycle', 'pedestrian', 'traffic_cone', 'barrier', 'car', 'truck', 'trailer', 'bus', 'construction_vehicle' ] +backend_args = None train_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), - dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), + dict( + type='LoadPointsFromMultiSweeps', + sweeps_num=10, + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( type='GlobalRotScaleTrans', @@ -34,8 +43,16 @@ keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), - dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), + dict( + type='LoadPointsFromMultiSweeps', + sweeps_num=10, + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), diff --git a/data/s3dis/indoor3d_util.py b/data/s3dis/indoor3d_util.py index 5ccb0af2c4..f467e0d52b 100644 --- a/data/s3dis/indoor3d_util.py +++ b/data/s3dis/indoor3d_util.py @@ -50,5 +50,5 @@ def export(anno_path, out_filename): data_label[:, 0:3] -= xyz_min np.save(f'{out_filename}_point.npy', data_label[:, :6].astype(np.float32)) - np.save(f'{out_filename}_sem_label.npy', data_label[:, 6].astype(np.int)) - np.save(f'{out_filename}_ins_label.npy', data_label[:, 7].astype(np.int)) + np.save(f'{out_filename}_sem_label.npy', data_label[:, 6].astype(np.int64)) + np.save(f'{out_filename}_ins_label.npy', data_label[:, 7].astype(np.int64)) diff --git a/docs/en/advanced_guides/datasets/s3dis_sem_seg.md b/docs/en/advanced_guides/datasets/s3dis_sem_seg.md index 3b65e4a3a2..23331a04bf 100644 --- a/docs/en/advanced_guides/datasets/s3dis_sem_seg.md +++ b/docs/en/advanced_guides/datasets/s3dis_sem_seg.md @@ -86,8 +86,8 @@ def export(anno_path, out_filename): data_label[:, 0:3] -= xyz_min np.save(f'{out_filename}_point.npy', data_label[:, :6].astype(np.float32)) - np.save(f'{out_filename}_sem_label.npy', data_label[:, 6].astype(np.int)) - np.save(f'{out_filename}_ins_label.npy', data_label[:, 7].astype(np.int)) + np.save(f'{out_filename}_sem_label.npy', data_label[:, 6].astype(np.int64)) + np.save(f'{out_filename}_ins_label.npy', data_label[:, 7].astype(np.int64)) ``` diff --git a/docs/en/notes/faq.md b/docs/en/notes/faq.md index 4ce0792afa..b0b30c36af 100644 --- a/docs/en/notes/faq.md +++ b/docs/en/notes/faq.md @@ -10,7 +10,7 @@ We list some potential troubles encountered by users and developers, along with | MMDetection3D version | MMEngine version | MMCV version | MMDetection version | | --------------------- | :----------------------: | :---------------------: | :----------------------: | - | dev-1.x | mmengine>=0.4.0, \<1.0.0 | mmcv>=2.0.0rc4, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | + | dev-1.x | mmengine>=0.6.0, \<1.0.0 | mmcv>=2.0.0rc4, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | | v1.1.0rc3 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | | v1.1.0rc2 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | | v1.1.0rc1 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | diff --git a/docs/en/user_guides/backends_support.md b/docs/en/user_guides/backends_support.md index 08b2c4733e..838fedefda 100644 --- a/docs/en/user_guides/backends_support.md +++ b/docs/en/user_guides/backends_support.md @@ -8,7 +8,7 @@ We support loading data and generated annotation info files (pkl and json) from ```python # set file client backends as Ceph -file_client_args = dict( +backend_args = dict( backend='petrel', path_mapping=dict({ './data/nuscenes/': @@ -30,15 +30,15 @@ db_sampler = dict( coord_type='LIDAR', load_dim=4, use_dim=4, - file_client_args=file_client_args), + backend_args=backend_args), # set file client for data base sampler to load db info file - file_client_args=file_client_args) + backend_args=backend_args) train_pipeline = [ # set file client for loading training data - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4, file_client_args=file_client_args), + dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4, backend_args=backend_args), # set file client for loading training data annotations - dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True, file_client_args=file_client_args), + dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True, backend_args=backend_args), dict(type='ObjectSample', db_sampler=db_sampler), dict( type='ObjectNoise', @@ -59,7 +59,7 @@ train_pipeline = [ ] test_pipeline = [ # set file client for loading validation/testing data - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4, file_client_args=file_client_args), + dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4, backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), @@ -87,11 +87,11 @@ data = dict( train=dict( type='RepeatDataset', times=2, - dataset=dict(pipeline=train_pipeline, classes=class_names, file_client_args=file_client_args)), + dataset=dict(pipeline=train_pipeline, classes=class_names, backend_args=backend_args)), # set file client for loading validation info files (.pkl) - val=dict(pipeline=test_pipeline, classes=class_names,file_client_args=file_client_args), + val=dict(pipeline=test_pipeline, classes=class_names,backend_args=backend_args), # set file client for loading testing info files (.pkl) - test=dict(pipeline=test_pipeline, classes=class_names, file_client_args=file_client_args)) + test=dict(pipeline=test_pipeline, classes=class_names, backend_args=backend_args)) ``` ## Load pretrained model from Ceph diff --git a/docs/en/user_guides/config.md b/docs/en/user_guides/config.md index 3c53eb325e..2d4358e523 100644 --- a/docs/en/user_guides/config.md +++ b/docs/en/user_guides/config.md @@ -466,11 +466,11 @@ train_pipeline = [ type='LoadPointsFromFile', load_dim=5, use_dim=5, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=10, - file_client_args=file_client_args), + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( type='GlobalRotScaleTrans', @@ -491,11 +491,11 @@ test_pipeline = [ type='LoadPointsFromFile', load_dim=5, use_dim=5, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=10, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), diff --git a/docs/en/user_guides/data_pipeline.md b/docs/en/user_guides/data_pipeline.md index c5fd1c5c60..01f5c61b99 100644 --- a/docs/en/user_guides/data_pipeline.md +++ b/docs/en/user_guides/data_pipeline.md @@ -28,11 +28,11 @@ train_pipeline = [ type='LoadPointsFromFile', load_dim=5, use_dim=5, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=10, - file_client_args=file_client_args), + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( type='GlobalRotScaleTrans', @@ -52,11 +52,11 @@ test_pipeline = [ type='LoadPointsFromFile', load_dim=5, use_dim=5, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=10, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='MultiScaleFlipAug', img_scale=(1333, 800), @@ -176,11 +176,11 @@ For each operation, we list the related dict fields that are added/updated/remov type='LoadPointsFromFile', load_dim=5, use_dim=5, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=10, - file_client_args=file_client_args), + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( type='GlobalRotScaleTrans', diff --git a/docs/en/user_guides/dataset_prepare.md b/docs/en/user_guides/dataset_prepare.md index c66083046b..345d31dc1a 100644 --- a/docs/en/user_guides/dataset_prepare.md +++ b/docs/en/user_guides/dataset_prepare.md @@ -122,7 +122,7 @@ Note that: ann_file='./data/waymo/kitti_format/waymo_infos_val.pkl', waymo_bin_file='./data/waymo/waymo_format/gt.bin', data_root='./data/waymo/waymo_format', - file_client_args=file_client_args, + backend_args=backend_args, convert_kitti_format=True, idx2metainfo='data/waymo/waymo_format/idx2metainfo.pkl' ) diff --git a/docs/zh_cn/advanced_guides/datasets/s3dis_sem_seg.md b/docs/zh_cn/advanced_guides/datasets/s3dis_sem_seg.md index 818da798f4..62dd2ba38e 100644 --- a/docs/zh_cn/advanced_guides/datasets/s3dis_sem_seg.md +++ b/docs/zh_cn/advanced_guides/datasets/s3dis_sem_seg.md @@ -89,8 +89,8 @@ def export(anno_path, out_filename): data_label[:, 0:3] -= xyz_min np.save(f'{out_filename}_point.npy', data_label[:, :6].astype(np.float32)) - np.save(f'{out_filename}_sem_label.npy', data_label[:, 6].astype(np.int)) - np.save(f'{out_filename}_ins_label.npy', data_label[:, 7].astype(np.int)) + np.save(f'{out_filename}_sem_label.npy', data_label[:, 6].astype(np.int64)) + np.save(f'{out_filename}_ins_label.npy', data_label[:, 7].astype(np.int64)) ``` diff --git a/docs/zh_cn/notes/faq.md b/docs/zh_cn/notes/faq.md index 0b8083cc03..1314db48e8 100644 --- a/docs/zh_cn/notes/faq.md +++ b/docs/zh_cn/notes/faq.md @@ -10,7 +10,7 @@ | MMDetection3D 版本 | MMEngine 版本 | MMCV 版本 | MMDetection 版本 | | ------------------ | :----------------------: | :---------------------: | :----------------------: | - | dev-1.x | mmengine>=0.4.0, \<1.0.0 | mmcv>=2.0.0rc4, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | + | dev-1.x | mmengine>=0.6.0, \<1.0.0 | mmcv>=2.0.0rc4, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | | v1.1.0rc3 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | | v1.1.0rc2 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | | v1.1.0rc1 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | diff --git a/docs/zh_cn/user_guides/backends_support.md b/docs/zh_cn/user_guides/backends_support.md index 8ed8796f9d..80c535de5f 100644 --- a/docs/zh_cn/user_guides/backends_support.md +++ b/docs/zh_cn/user_guides/backends_support.md @@ -8,7 +8,7 @@ ```python # set file client backends as Ceph -file_client_args = dict( +backend_args = dict( backend='petrel', path_mapping=dict({ './data/nuscenes/': @@ -30,15 +30,15 @@ db_sampler = dict( coord_type='LIDAR', load_dim=4, use_dim=4, - file_client_args=file_client_args), + backend_args=backend_args), # set file client for data base sampler to load db info file - file_client_args=file_client_args) + backend_args=backend_args) train_pipeline = [ # set file client for loading training data - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4, file_client_args=file_client_args), + dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4, backend_args=backend_args), # set file client for loading training data annotations - dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True, file_client_args=file_client_args), + dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True, backend_args=backend_args), dict(type='ObjectSample', db_sampler=db_sampler), dict( type='ObjectNoise', @@ -59,7 +59,7 @@ train_pipeline = [ ] test_pipeline = [ # set file client for loading validation/testing data - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4, file_client_args=file_client_args), + dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4, backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), @@ -87,11 +87,11 @@ data = dict( train=dict( type='RepeatDataset', times=2, - dataset=dict(pipeline=train_pipeline, classes=class_names, file_client_args=file_client_args)), + dataset=dict(pipeline=train_pipeline, classes=class_names, backend_args=backend_args)), # set file client for loading validation info files (.pkl) - val=dict(pipeline=test_pipeline, classes=class_names,file_client_args=file_client_args), + val=dict(pipeline=test_pipeline, classes=class_names,backend_args=backend_args), # set file client for loading testing info files (.pkl) - test=dict(pipeline=test_pipeline, classes=class_names, file_client_args=file_client_args)) + test=dict(pipeline=test_pipeline, classes=class_names, backend_args=backend_args)) ``` ## 从 Ceph 读取预训练模型 diff --git a/docs/zh_cn/user_guides/config.md b/docs/zh_cn/user_guides/config.md index 73da60a05b..f971a10855 100644 --- a/docs/zh_cn/user_guides/config.md +++ b/docs/zh_cn/user_guides/config.md @@ -459,11 +459,11 @@ train_pipeline = [ type='LoadPointsFromFile', load_dim=5, use_dim=5, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=10, - file_client_args=file_client_args), + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( type='GlobalRotScaleTrans', @@ -484,11 +484,11 @@ test_pipeline = [ type='LoadPointsFromFile', load_dim=5, use_dim=5, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=10, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), diff --git a/docs/zh_cn/user_guides/data_pipeline.md b/docs/zh_cn/user_guides/data_pipeline.md index bdc595e881..cf50d70ff6 100644 --- a/docs/zh_cn/user_guides/data_pipeline.md +++ b/docs/zh_cn/user_guides/data_pipeline.md @@ -20,11 +20,11 @@ train_pipeline = [ type='LoadPointsFromFile', load_dim=5, use_dim=5, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=10, - file_client_args=file_client_args), + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( type='GlobalRotScaleTrans', @@ -44,11 +44,11 @@ test_pipeline = [ type='LoadPointsFromFile', load_dim=5, use_dim=5, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=10, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='MultiScaleFlipAug', img_scale=(1333, 800), @@ -168,11 +168,11 @@ test_pipeline = [ type='LoadPointsFromFile', load_dim=5, use_dim=5, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=10, - file_client_args=file_client_args), + backend_args=backend_args), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( type='GlobalRotScaleTrans', diff --git a/docs/zh_cn/user_guides/dataset_prepare.md b/docs/zh_cn/user_guides/dataset_prepare.md index bcf4de1587..094cd01dbf 100644 --- a/docs/zh_cn/user_guides/dataset_prepare.md +++ b/docs/zh_cn/user_guides/dataset_prepare.md @@ -121,7 +121,7 @@ python tools/create_data.py waymo --root-path ./data/waymo/ --out-dir ./data/way ann_file='./data/waymo/kitti_format/waymo_infos_val.pkl', waymo_bin_file='./data/waymo/waymo_format/gt.bin', data_root='./data/waymo/waymo_format', - file_client_args=file_client_args, + backend_args=backend_args, convert_kitti_format=True, idx2metainfo='data/waymo/waymo_format/idx2metainfo.pkl' ) diff --git a/mmdet3d/__init__.py b/mmdet3d/__init__.py index ff3ed0e7fd..ac6235cfd2 100644 --- a/mmdet3d/__init__.py +++ b/mmdet3d/__init__.py @@ -6,11 +6,11 @@ from .version import __version__, version_info -mmcv_minimum_version = '2.0.0rc0' +mmcv_minimum_version = '2.0.0rc4' mmcv_maximum_version = '2.1.0' mmcv_version = digit_version(mmcv.__version__) -mmengine_minimum_version = '0.4.0' +mmengine_minimum_version = '0.6.0' mmengine_maximum_version = '1.0.0' mmengine_version = digit_version(mmengine.__version__) diff --git a/mmdet3d/datasets/det3d_dataset.py b/mmdet3d/datasets/det3d_dataset.py index 38b6d6300b..9eeb5dd78e 100644 --- a/mmdet3d/datasets/det3d_dataset.py +++ b/mmdet3d/datasets/det3d_dataset.py @@ -4,7 +4,6 @@ from os import path as osp from typing import Callable, List, Optional, Set, Union -import mmengine import numpy as np import torch from mmengine.dataset import BaseDataset @@ -61,8 +60,8 @@ class Det3DDataset(BaseDataset): load_eval_anns (bool): Whether to load annotations in test_mode, the annotation will be save in `eval_ann_infos`, which can be used in Evaluator. Defaults to True. - file_client_args (dict): Configuration of file client. - Defaults to dict(backend='disk'). + backend_args (dict, optional): Arguments to instantiate the + corresponding backend. Defaults to None. show_ins_var (bool): For debug purpose. Whether to show variation of the number of instances before and after through pipeline. Defaults to False. @@ -80,11 +79,10 @@ def __init__(self, filter_empty_gt: bool = True, test_mode: bool = False, load_eval_anns: bool = True, - file_client_args: dict = dict(backend='disk'), + backend_args: Optional[dict] = None, show_ins_var: bool = False, **kwargs) -> None: - # init file client - self.file_client = mmengine.FileClient(**file_client_args) + self.backend_args = backend_args self.filter_empty_gt = filter_empty_gt self.load_eval_anns = load_eval_anns _default_modality_keys = ('use_lidar', 'use_camera') diff --git a/mmdet3d/datasets/s3dis_dataset.py b/mmdet3d/datasets/s3dis_dataset.py index e40f8c3fed..0fa61da979 100644 --- a/mmdet3d/datasets/s3dis_dataset.py +++ b/mmdet3d/datasets/s3dis_dataset.py @@ -75,7 +75,7 @@ def __init__(self, seg_valid_cat_ids = self.METAINFO['seg_valid_class_ids'] neg_label = len(seg_valid_cat_ids) seg_label_mapping = np.ones( - seg_max_cat_id + 1, dtype=np.int) * neg_label + seg_max_cat_id + 1, dtype=np.int64) * neg_label for cls_idx, cat_id in enumerate(seg_valid_cat_ids): seg_label_mapping[cat_id] = cls_idx self.seg_label_mapping = seg_label_mapping diff --git a/mmdet3d/datasets/scannet_dataset.py b/mmdet3d/datasets/scannet_dataset.py index 08830687fa..c59e36a252 100644 --- a/mmdet3d/datasets/scannet_dataset.py +++ b/mmdet3d/datasets/scannet_dataset.py @@ -80,7 +80,7 @@ def __init__(self, seg_valid_cat_ids = self.METAINFO['seg_valid_class_ids'] neg_label = len(seg_valid_cat_ids) seg_label_mapping = np.ones( - seg_max_cat_id + 1, dtype=np.int) * neg_label + seg_max_cat_id + 1, dtype=np.int64) * neg_label for cls_idx, cat_id in enumerate(seg_valid_cat_ids): seg_label_mapping[cat_id] = cls_idx self.seg_label_mapping = seg_label_mapping @@ -331,7 +331,7 @@ def __init__(self, test_mode: bool = False, ignore_index: Optional[int] = None, scene_idxs: Optional[Union[np.ndarray, str]] = None, - file_client_args: dict = dict(backend='disk'), + backend_args: Optional[dict] = None, **kwargs) -> None: super().__init__( data_root=data_root, @@ -343,5 +343,5 @@ def __init__(self, test_mode=test_mode, ignore_index=ignore_index, scene_idxs=scene_idxs, - file_client_args=file_client_args, + backend_args=backend_args, **kwargs) diff --git a/mmdet3d/datasets/seg3d_dataset.py b/mmdet3d/datasets/seg3d_dataset.py index e2bb74b91a..3f30fb6ccb 100644 --- a/mmdet3d/datasets/seg3d_dataset.py +++ b/mmdet3d/datasets/seg3d_dataset.py @@ -2,9 +2,9 @@ from os import path as osp from typing import Callable, List, Optional, Sequence, Union -import mmengine import numpy as np from mmengine.dataset import BaseDataset +from mmengine.fileio import get_local_path from mmdet3d.registry import DATASETS @@ -49,8 +49,8 @@ class Seg3DDataset(BaseDataset): load_eval_anns (bool): Whether to load annotations in test_mode, the annotation will be save in `eval_ann_infos`, which can be used in Evaluator. Defaults to True. - file_client_args (dict): Configuration of file client. - Defaults to dict(backend='disk'). + backend_args (dict, optional): Arguments to instantiate the + corresponding backend. Defaults to None. """ METAINFO = { 'classes': None, # names of all classes data used for the task @@ -75,10 +75,9 @@ def __init__(self, test_mode: bool = False, serialize_data: bool = False, load_eval_anns: bool = True, - file_client_args: dict = dict(backend='disk'), + backend_args: Optional[dict] = None, **kwargs) -> None: - # init file client - self.file_client = mmengine.FileClient(**file_client_args) + self.backend_args = backend_args self.modality = modality self.load_eval_anns = load_eval_anns @@ -203,7 +202,7 @@ def get_seg_label_mapping(self, metainfo=None): seg_valid_cat_ids = self.METAINFO['seg_valid_class_ids'] neg_label = len(seg_valid_cat_ids) seg_label_mapping = np.ones( - seg_max_cat_id + 1, dtype=np.int) * neg_label + seg_max_cat_id + 1, dtype=np.int64) * neg_label for cls_idx, cat_id in enumerate(seg_valid_cat_ids): seg_label_mapping[cat_id] = cls_idx return seg_label_mapping @@ -317,7 +316,8 @@ def get_scene_idxs(self, scene_idxs: Union[None, str, scene_idxs = np.arange(len(self)) if isinstance(scene_idxs, str): scene_idxs = osp.join(self.data_root, scene_idxs) - with self.file_client.get_local_path(scene_idxs) as local_path: + with get_local_path( + scene_idxs, backend_args=self.backend_args) as local_path: scene_idxs = np.load(local_path) else: scene_idxs = np.array(scene_idxs) diff --git a/mmdet3d/datasets/transforms/dbsampler.py b/mmdet3d/datasets/transforms/dbsampler.py index df57420d63..56e8440b74 100644 --- a/mmdet3d/datasets/transforms/dbsampler.py +++ b/mmdet3d/datasets/transforms/dbsampler.py @@ -5,6 +5,7 @@ import mmengine import numpy as np +from mmengine.fileio import get_local_path from mmdet3d.datasets.transforms import data_augment_utils from mmdet3d.registry import TRANSFORMS @@ -91,26 +92,24 @@ class DataBaseSampler(object): classes (list[str], optional): List of classes. Defaults to None. points_loader (dict): Config of points loader. Defaults to dict(type='LoadPointsFromFile', load_dim=4, use_dim=[0, 1, 2, 3]). - file_client_args (dict): Arguments to instantiate a FileClient. - See :class:`mmengine.fileio.FileClient` for details. - Defaults to dict(backend='disk'). + backend_args (dict, optional): Arguments to instantiate the + corresponding backend. Defaults to None. """ - def __init__( - self, - info_path: str, - data_root: str, - rate: float, - prepare: dict, - sample_groups: dict, - classes: Optional[List[str]] = None, - points_loader: dict = dict( - type='LoadPointsFromFile', - coord_type='LIDAR', - load_dim=4, - use_dim=[0, 1, 2, 3]), - file_client_args: dict = dict(backend='disk') - ) -> None: + def __init__(self, + info_path: str, + data_root: str, + rate: float, + prepare: dict, + sample_groups: dict, + classes: Optional[List[str]] = None, + points_loader: dict = dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=4, + use_dim=[0, 1, 2, 3], + backend_args=None), + backend_args: Optional[dict] = None) -> None: super().__init__() self.data_root = data_root self.info_path = info_path @@ -120,10 +119,11 @@ def __init__( self.cat2label = {name: i for i, name in enumerate(classes)} self.label2cat = {i: name for i, name in enumerate(classes)} self.points_loader = TRANSFORMS.build(points_loader) - self.file_client = mmengine.FileClient(**file_client_args) + self.backend_args = backend_args # load data base infos - with self.file_client.get_local_path(info_path) as local_path: + with get_local_path( + info_path, backend_args=self.backend_args) as local_path: # loading data from a file-like object needs file format db_infos = mmengine.load(open(local_path, 'rb'), file_format='pkl') diff --git a/mmdet3d/datasets/transforms/loading.py b/mmdet3d/datasets/transforms/loading.py index 58782b1d95..efb54c2fff 100644 --- a/mmdet3d/datasets/transforms/loading.py +++ b/mmdet3d/datasets/transforms/loading.py @@ -4,11 +4,11 @@ import mmcv import mmengine -import mmengine.fileio as fileio import numpy as np from mmcv.transforms import LoadImageFromFile from mmcv.transforms.base import BaseTransform from mmdet.datasets.transforms import LoadAnnotations +from mmengine.fileio import get from mmdet3d.registry import TRANSFORMS from mmdet3d.structures.bbox_3d import get_box_type @@ -25,9 +25,8 @@ class LoadMultiViewImageFromFiles(BaseTransform): to_float32 (bool): Whether to convert the img to float32. Defaults to False. color_type (str): Color type of the file. Defaults to 'unchanged'. - file_client_args (dict): Arguments to instantiate a FileClient. - See :class:`mmengine.fileio.FileClient` for details. - Defaults to dict(backend='disk'). + backend_args (dict, optional): Arguments to instantiate the + corresponding backend. Defaults to None. num_views (int): Number of view in a frame. Defaults to 5. num_ref_frames (int): Number of frame in loading. Defaults to -1. test_mode (bool): Whether is test mode in loading. Defaults to False. @@ -38,15 +37,14 @@ class LoadMultiViewImageFromFiles(BaseTransform): def __init__(self, to_float32: bool = False, color_type: str = 'unchanged', - file_client_args: dict = dict(backend='disk'), + backend_args: Optional[dict] = None, num_views: int = 5, num_ref_frames: int = -1, test_mode: bool = False, set_default_scale: bool = True) -> None: self.to_float32 = to_float32 self.color_type = color_type - self.file_client_args = file_client_args.copy() - self.file_client = None + self.backend_args = backend_args self.num_views = num_views # num_ref_frames is used for multi-sweep loading self.num_ref_frames = num_ref_frames @@ -164,12 +162,11 @@ def transform(self, results: dict) -> Optional[dict]: results['ori_cam2img'] = copy.deepcopy(results['cam2img']) - if self.file_client is None: - self.file_client = mmengine.FileClient(**self.file_client_args) - # img is of shape (h, w, c, num_views) # h and w can be different for different views - img_bytes = [self.file_client.get(name) for name in filename] + img_bytes = [ + get(name, backend_args=self.backend_args) for name in filename + ] imgs = [ mmcv.imfrombytes(img_byte, flag=self.color_type) for img_byte in img_bytes @@ -257,13 +254,7 @@ def transform(self, results: dict) -> dict: 'nuscenes datasets') try: - if self.file_client_args is not None: - file_client = fileio.FileClient.infer_client( - self.file_client_args, filename) - img_bytes = file_client.get(filename) - else: - img_bytes = fileio.get( - filename, backend_args=self.backend_args) + img_bytes = get(filename, backend_args=self.backend_args) img = mmcv.imfrombytes( img_bytes, flag=self.color_type, backend=self.imdecode_backend) except Exception as e: @@ -331,9 +322,8 @@ class LoadPointsFromMultiSweeps(BaseTransform): sweeps_num (int): Number of sweeps. Defaults to 10. load_dim (int): Dimension number of the loaded points. Defaults to 5. use_dim (list[int]): Which dimension to use. Defaults to [0, 1, 2, 4]. - file_client_args (dict): Arguments to instantiate a FileClient. - See :class:`mmengine.fileio.FileClient` for details. - Defaults to dict(backend='disk'). + backend_args (dict, optional): Arguments to instantiate the + corresponding backend. Defaults to None. pad_empty_sweeps (bool): Whether to repeat keyframe when sweeps is empty. Defaults to False. remove_close (bool): Whether to remove close points. Defaults to False. @@ -345,7 +335,7 @@ def __init__(self, sweeps_num: int = 10, load_dim: int = 5, use_dim: List[int] = [0, 1, 2, 4], - file_client_args: dict = dict(backend='disk'), + backend_args: Optional[dict] = None, pad_empty_sweeps: bool = False, remove_close: bool = False, test_mode: bool = False) -> None: @@ -356,8 +346,7 @@ def __init__(self, assert max(use_dim) < load_dim, \ f'Expect all used dimensions < {load_dim}, got {use_dim}' self.use_dim = use_dim - self.file_client_args = file_client_args.copy() - self.file_client = mmengine.FileClient(**self.file_client_args) + self.backend_args = backend_args self.pad_empty_sweeps = pad_empty_sweeps self.remove_close = remove_close self.test_mode = test_mode @@ -371,10 +360,8 @@ def _load_points(self, pts_filename: str) -> np.ndarray: Returns: np.ndarray: An array containing point clouds data. """ - if self.file_client is None: - self.file_client = mmengine.FileClient(**self.file_client_args) try: - pts_bytes = self.file_client.get(pts_filename) + pts_bytes = get(pts_filename, backend_args=self.backend_args) points = np.frombuffer(pts_bytes, dtype=np.float32) except ConnectionError: mmengine.check_file_exist(pts_filename) @@ -592,21 +579,18 @@ class LoadPointsFromFile(BaseTransform): use_color (bool): Whether to use color features. Defaults to False. norm_intensity (bool): Whether to normlize the intensity. Defaults to False. - file_client_args (dict): Arguments to instantiate a FileClient. - See :class:`mmengine.fileio.FileClient` for details. - Defaults to dict(backend='disk'). + backend_args (dict, optional): Arguments to instantiate the + corresponding backend. Defaults to None. """ - def __init__( - self, - coord_type: str, - load_dim: int = 6, - use_dim: Union[int, List[int]] = [0, 1, 2], - shift_height: bool = False, - use_color: bool = False, - norm_intensity: bool = False, - file_client_args: dict = dict(backend='disk') - ) -> None: + def __init__(self, + coord_type: str, + load_dim: int = 6, + use_dim: Union[int, List[int]] = [0, 1, 2], + shift_height: bool = False, + use_color: bool = False, + norm_intensity: bool = False, + backend_args: Optional[dict] = None) -> None: self.shift_height = shift_height self.use_color = use_color if isinstance(use_dim, int): @@ -619,8 +603,7 @@ def __init__( self.load_dim = load_dim self.use_dim = use_dim self.norm_intensity = norm_intensity - self.file_client_args = file_client_args.copy() - self.file_client = None + self.backend_args = backend_args def _load_points(self, pts_filename: str) -> np.ndarray: """Private function to load point clouds data. @@ -631,10 +614,8 @@ def _load_points(self, pts_filename: str) -> np.ndarray: Returns: np.ndarray: An array containing point clouds data. """ - if self.file_client is None: - self.file_client = mmengine.FileClient(**self.file_client_args) try: - pts_bytes = self.file_client.get(pts_filename) + pts_bytes = get(pts_filename, backend_args=self.backend_args) points = np.frombuffer(pts_bytes, dtype=np.float32) except ConnectionError: mmengine.check_file_exist(pts_filename) @@ -698,7 +679,7 @@ def __repr__(self) -> str: repr_str = self.__class__.__name__ + '(' repr_str += f'shift_height={self.shift_height}, ' repr_str += f'use_color={self.use_color}, ' - repr_str += f'file_client_args={self.file_client_args}, ' + repr_str += f'backend_args={self.backend_args}, ' repr_str += f'load_dim={self.load_dim}, ' repr_str += f'use_dim={self.use_dim})' return repr_str @@ -807,37 +788,34 @@ class LoadAnnotations3D(LoadAnnotations): panoptic labels. Defaults to None. dataset_type (str): Type of dataset used for splitting semantic and instance labels. Defaults to None. - file_client_args (dict): Arguments to instantiate a FileClient. - See :class:`mmengine.fileio.FileClient` for details. - Defaults to dict(backend='disk'). + backend_args (dict, optional): Arguments to instantiate the + corresponding backend. Defaults to None. """ - def __init__( - self, - with_bbox_3d: bool = True, - with_label_3d: bool = True, - with_attr_label: bool = False, - with_mask_3d: bool = False, - with_seg_3d: bool = False, - with_bbox: bool = False, - with_label: bool = False, - with_mask: bool = False, - with_seg: bool = False, - with_bbox_depth: bool = False, - with_panoptic_3d: bool = False, - poly2mask: bool = True, - seg_3d_dtype: str = 'np.int64', - seg_offset: int = None, - dataset_type: str = None, - file_client_args: dict = dict(backend='disk') - ) -> None: + def __init__(self, + with_bbox_3d: bool = True, + with_label_3d: bool = True, + with_attr_label: bool = False, + with_mask_3d: bool = False, + with_seg_3d: bool = False, + with_bbox: bool = False, + with_label: bool = False, + with_mask: bool = False, + with_seg: bool = False, + with_bbox_depth: bool = False, + with_panoptic_3d: bool = False, + poly2mask: bool = True, + seg_3d_dtype: str = 'np.int64', + seg_offset: int = None, + dataset_type: str = None, + backend_args: Optional[dict] = None) -> None: super().__init__( with_bbox=with_bbox, with_label=with_label, with_mask=with_mask, with_seg=with_seg, poly2mask=poly2mask, - file_client_args=file_client_args) + backend_args=backend_args) self.with_bbox_3d = with_bbox_3d self.with_bbox_depth = with_bbox_depth self.with_label_3d = with_label_3d @@ -848,7 +826,6 @@ def __init__( self.seg_3d_dtype = eval(seg_3d_dtype) self.seg_offset = seg_offset self.dataset_type = dataset_type - self.file_client = None def _load_bboxes_3d(self, results: dict) -> dict: """Private function to move the 3D bounding box annotation from @@ -914,10 +891,9 @@ def _load_masks_3d(self, results: dict) -> dict: """ pts_instance_mask_path = results['pts_instance_mask_path'] - if self.file_client is None: - self.file_client = mmengine.FileClient(**self.file_client_args) try: - mask_bytes = self.file_client.get(pts_instance_mask_path) + mask_bytes = get( + pts_instance_mask_path, backend_args=self.backend_args) pts_instance_mask = np.frombuffer(mask_bytes, dtype=np.int64) except ConnectionError: mmengine.check_file_exist(pts_instance_mask_path) @@ -941,10 +917,9 @@ def _load_semantic_seg_3d(self, results: dict) -> dict: """ pts_semantic_mask_path = results['pts_semantic_mask_path'] - if self.file_client is None: - self.file_client = mmengine.FileClient(**self.file_client_args) try: - mask_bytes = self.file_client.get(pts_semantic_mask_path) + mask_bytes = get( + pts_semantic_mask_path, backend_args=self.backend_args) # add .copy() to fix read-only bug pts_semantic_mask = np.frombuffer( mask_bytes, dtype=self.seg_3d_dtype).copy() @@ -976,10 +951,9 @@ def _load_panoptic_3d(self, results: dict) -> dict: """ pts_panoptic_mask_path = results['pts_panoptic_mask_path'] - if self.file_client is None: - self.file_client = mmengine.FileClient(**self.file_client_args) try: - mask_bytes = self.file_client.get(pts_panoptic_mask_path) + mask_bytes = get( + pts_panoptic_mask_path, backend_args=self.backend_args) # add .copy() to fix read-only bug pts_panoptic_mask = np.frombuffer( mask_bytes, dtype=self.seg_3d_dtype).copy() diff --git a/mmdet3d/datasets/transforms/transforms_3d.py b/mmdet3d/datasets/transforms/transforms_3d.py index 4ab0bfb8da..6b10e33b75 100644 --- a/mmdet3d/datasets/transforms/transforms_3d.py +++ b/mmdet3d/datasets/transforms/transforms_3d.py @@ -878,7 +878,7 @@ def transform(self, input_dict: dict) -> dict: # using mask to index gt_labels_3d will cause bug when # len(gt_labels_3d) == 1, where mask=1 will be interpreted # as gt_labels_3d[1] and cause out of index error - gt_labels_3d = gt_labels_3d[mask.numpy().astype(np.bool)] + gt_labels_3d = gt_labels_3d[mask.numpy().astype(bool)] # limit rad to [-pi, pi] gt_bboxes_3d.limit_yaw(offset=0.5, period=2 * np.pi) @@ -981,7 +981,7 @@ def transform(self, input_dict: dict) -> dict: """ gt_labels_3d = input_dict['gt_labels_3d'] gt_bboxes_mask = np.array([n in self.labels for n in gt_labels_3d], - dtype=np.bool_) + dtype=bool) input_dict['gt_bboxes_3d'] = input_dict['gt_bboxes_3d'][gt_bboxes_mask] input_dict['gt_labels_3d'] = input_dict['gt_labels_3d'][gt_bboxes_mask] @@ -1954,7 +1954,7 @@ class RandomCrop3D(RandomCrop): - gt_bboxes (np.float32) (optional) - gt_bboxes_labels (np.int64) (optional) - gt_masks (BitmapMasks | PolygonMasks) (optional) - - gt_ignore_flags (np.bool) (optional) + - gt_ignore_flags (bool) (optional) - gt_seg_map (np.uint8) (optional) Modified Keys: diff --git a/mmdet3d/datasets/waymo_dataset.py b/mmdet3d/datasets/waymo_dataset.py index aa431312ea..2887e9c02c 100644 --- a/mmdet3d/datasets/waymo_dataset.py +++ b/mmdet3d/datasets/waymo_dataset.py @@ -99,7 +99,7 @@ def __init__(self, self.cat_ids = range(len(self.METAINFO['classes'])) self.cat2label = {cat_id: i for i, cat_id in enumerate(self.cat_ids)} self.max_sweeps = max_sweeps - # we do not provide file_client_args to custom_3d init + # we do not provide backend_args to custom_3d init # because we want disk loading for info # while ceph loading for Prediction2Waymo super().__init__( diff --git a/mmdet3d/engine/hooks/visualization_hook.py b/mmdet3d/engine/hooks/visualization_hook.py index 3779995975..34c81ef5cf 100644 --- a/mmdet3d/engine/hooks/visualization_hook.py +++ b/mmdet3d/engine/hooks/visualization_hook.py @@ -5,7 +5,7 @@ import mmcv import numpy as np -from mmengine.fileio import FileClient +from mmengine.fileio import get from mmengine.hooks import Hook from mmengine.runner import Runner from mmengine.utils import mkdir_or_exist @@ -44,9 +44,8 @@ class Det3DVisualizationHook(Hook): wait_time (float): The interval of show (s). Defaults to 0. test_out_dir (str, optional): directory where painted images will be saved in testing process. - file_client_args (dict): Arguments to instantiate a FileClient. - See :class:`mmengine.fileio.FileClient` for details. - Defaults to ``dict(backend='disk')``. + backend_args (dict, optional): Arguments to instantiate the + corresponding backend. Defaults to None. """ def __init__(self, @@ -57,7 +56,7 @@ def __init__(self, vis_task: str = 'mono_det', wait_time: float = 0., test_out_dir: Optional[str] = None, - file_client_args: dict = dict(backend='disk')): + backend_args: Optional[dict] = None): self._visualizer: Visualizer = Visualizer.get_current_instance() self.interval = interval self.score_thr = score_thr @@ -72,8 +71,7 @@ def __init__(self, self.vis_task = vis_task self.wait_time = wait_time - self.file_client_args = file_client_args.copy() - self.file_client = None + self.backend_args = backend_args self.draw = draw self.test_out_dir = test_out_dir self._test_index = 0 @@ -92,9 +90,6 @@ def after_val_iter(self, runner: Runner, batch_idx: int, data_batch: dict, if self.draw is False: return - if self.file_client is None: - self.file_client = FileClient(**self.file_client_args) - # There is no guarantee that the same batch of images # is visualized for each evaluation. total_curr_iter = runner.iter + batch_idx @@ -104,14 +99,14 @@ def after_val_iter(self, runner: Runner, batch_idx: int, data_batch: dict, # Visualize only the first data if 'img_path' in outputs[0]: img_path = outputs[0].img_path - img_bytes = self.file_client.get(img_path) + img_bytes = get(img_path, backend_args=self.backend_args) img = mmcv.imfrombytes(img_bytes, channel_order='rgb') data_input['img'] = img if 'lidar_path' in outputs[0]: lidar_path = outputs[0].lidar_path num_pts_feats = outputs[0].num_pts_feats - pts_bytes = self.file_client.get(lidar_path) + pts_bytes = get(lidar_path, backend_args=self.backend_args) points = np.frombuffer(pts_bytes, dtype=np.float32) points = points.reshape(-1, num_pts_feats) data_input['points'] = points @@ -146,23 +141,20 @@ def after_test_iter(self, runner: Runner, batch_idx: int, data_batch: dict, self.test_out_dir) mkdir_or_exist(self.test_out_dir) - if self.file_client is None: - self.file_client = FileClient(**self.file_client_args) - for data_sample in outputs: self._test_index += 1 data_input = dict() if 'img_path' in data_sample: img_path = data_sample.img_path - img_bytes = self.file_client.get(img_path) + img_bytes = get(img_path, backend_args=self.backend_args) img = mmcv.imfrombytes(img_bytes, channel_order='rgb') data_input['img'] = img if 'lidar_path' in data_sample: lidar_path = data_sample.lidar_path num_pts_feats = data_sample.num_pts_feats - pts_bytes = self.file_client.get(lidar_path) + pts_bytes = get(lidar_path, backend_args=self.backend_args) points = np.frombuffer(pts_bytes, dtype=np.float32) points = points.reshape(-1, num_pts_feats) data_input['points'] = points diff --git a/mmdet3d/evaluation/functional/instance_seg_eval.py b/mmdet3d/evaluation/functional/instance_seg_eval.py index 5e83da962f..6d0717196a 100644 --- a/mmdet3d/evaluation/functional/instance_seg_eval.py +++ b/mmdet3d/evaluation/functional/instance_seg_eval.py @@ -29,7 +29,7 @@ def aggregate_predictions(masks, labels, scores, valid_class_ids): # match pred_instance['filename'] from assign_instances_for_scan file_name = f'{id}_{i}' info[file_name] = dict() - info[file_name]['mask'] = (mask == i).astype(np.int) + info[file_name]['mask'] = (mask == i).astype(np.int64) info[file_name]['label_id'] = valid_class_ids[label[i]] info[file_name]['conf'] = score[i] infos.append(info) diff --git a/mmdet3d/evaluation/functional/scannet_utils/evaluate_semantic_instance.py b/mmdet3d/evaluation/functional/scannet_utils/evaluate_semantic_instance.py index e4b94395fc..2b15747eff 100644 --- a/mmdet3d/evaluation/functional/scannet_utils/evaluate_semantic_instance.py +++ b/mmdet3d/evaluation/functional/scannet_utils/evaluate_semantic_instance.py @@ -59,7 +59,7 @@ def evaluate_matches(matches, class_labels, options): cur_true = np.ones(len(gt_instances)) cur_score = np.ones(len(gt_instances)) * (-float('inf')) - cur_match = np.zeros(len(gt_instances), dtype=np.bool) + cur_match = np.zeros(len(gt_instances), dtype=bool) # collect matches for (gti, gt) in enumerate(gt_instances): found_match = False diff --git a/mmdet3d/evaluation/functional/seg_eval.py b/mmdet3d/evaluation/functional/seg_eval.py index d0f631254c..b78df12034 100644 --- a/mmdet3d/evaluation/functional/seg_eval.py +++ b/mmdet3d/evaluation/functional/seg_eval.py @@ -88,8 +88,8 @@ def seg_eval(gt_labels, seg_preds, label2cat, ignore_index, logger=None): hist_list = [] for i in range(len(gt_labels)): - gt_seg = gt_labels[i].astype(np.int) - pred_seg = seg_preds[i].astype(np.int) + gt_seg = gt_labels[i].astype(np.int64) + pred_seg = seg_preds[i].astype(np.int64) # filter out ignored points pred_seg[gt_seg == ignore_index] = -1 diff --git a/mmdet3d/evaluation/functional/waymo_utils/prediction_to_waymo.py b/mmdet3d/evaluation/functional/waymo_utils/prediction_to_waymo.py index 46f52e7eb2..b9da8043d2 100644 --- a/mmdet3d/evaluation/functional/waymo_utils/prediction_to_waymo.py +++ b/mmdet3d/evaluation/functional/waymo_utils/prediction_to_waymo.py @@ -41,8 +41,8 @@ class Prediction2Waymo(object): validation and 2 for testing. classes (dict): A list of class name. workers (str): Number of parallel processes. Defaults to 2. - file_client_args (str): File client for reading gt in waymo format. - Defaults to ``dict(backend='disk')``. + backend_args (dict, optional): Arguments to instantiate the + corresponding backend. Defaults to None. from_kitti_format (bool, optional): Whether the reuslts are kitti format. Defaults to False. idx2metainfo (Optional[dict], optional): The mapping from sample_idx to @@ -58,7 +58,7 @@ def __init__(self, prefix: str, classes: dict, workers: int = 2, - file_client_args: dict = dict(backend='disk'), + backend_args: Optional[dict] = None, from_kitti_format: bool = False, idx2metainfo: Optional[dict] = None): @@ -69,7 +69,7 @@ def __init__(self, self.prefix = prefix self.classes = classes self.workers = int(workers) - self.file_client_args = file_client_args + self.backend_args = backend_args self.from_kitti_format = from_kitti_format if idx2metainfo is not None: self.idx2metainfo = idx2metainfo @@ -114,12 +114,12 @@ def __init__(self, def get_file_names(self): """Get file names of waymo raw data.""" - if 'path_mapping' in self.file_client_args: - for path in self.file_client_args['path_mapping'].keys(): + if 'path_mapping' in self.backend_args: + for path in self.backend_args['path_mapping'].keys(): if path in self.waymo_tfrecords_dir: self.waymo_tfrecords_dir = \ self.waymo_tfrecords_dir.replace( - path, self.file_client_args['path_mapping'][path]) + path, self.backend_args['path_mapping'][path]) from petrel_client.client import Client client = Client() contents = client.list(self.waymo_tfrecords_dir) diff --git a/mmdet3d/evaluation/metrics/kitti_metric.py b/mmdet3d/evaluation/metrics/kitti_metric.py index 3fa65fde54..51a35c3e38 100644 --- a/mmdet3d/evaluation/metrics/kitti_metric.py +++ b/mmdet3d/evaluation/metrics/kitti_metric.py @@ -47,24 +47,21 @@ class KittiMetric(BaseMetric): collect_device (str): Device name used for collecting results from different ranks during distributed training. Must be 'cpu' or 'gpu'. Defaults to 'cpu'. - file_client_args (dict): Arguments to instantiate a FileClient. - See :class:`mmengine.fileio.FileClient` for details. - Defaults to dict(backend='disk'). + backend_args (dict, optional): Arguments to instantiate the + corresponding backend. Defaults to None. """ - def __init__( - self, - ann_file: str, - metric: Union[str, List[str]] = 'bbox', - pcd_limit_range: List[float] = [0, -40, -3, 70.4, 40, 0.0], - prefix: Optional[str] = None, - pklfile_prefix: Optional[str] = None, - default_cam_key: str = 'CAM2', - format_only: bool = False, - submission_prefix: Optional[str] = None, - collect_device: str = 'cpu', - file_client_args: dict = dict(backend='disk') - ) -> None: + def __init__(self, + ann_file: str, + metric: Union[str, List[str]] = 'bbox', + pcd_limit_range: List[float] = [0, -40, -3, 70.4, 40, 0.0], + prefix: Optional[str] = None, + pklfile_prefix: Optional[str] = None, + default_cam_key: str = 'CAM2', + format_only: bool = False, + submission_prefix: Optional[str] = None, + collect_device: str = 'cpu', + backend_args: Optional[dict] = None) -> None: self.default_prefix = 'Kitti metric' super(KittiMetric, self).__init__( collect_device=collect_device, prefix=prefix) @@ -80,7 +77,7 @@ def __init__( self.submission_prefix = submission_prefix self.default_cam_key = default_cam_key - self.file_client_args = file_client_args + self.backend_args = backend_args allowed_metrics = ['bbox', 'img_bbox', 'mAP', 'LET_mAP'] self.metrics = metric if isinstance(metric, list) else [metric] @@ -188,7 +185,7 @@ def compute_metrics(self, results: List[dict]) -> Dict[str, float]: self.classes = self.dataset_meta['classes'] # load annotations - pkl_infos = load(self.ann_file, file_client_args=self.file_client_args) + pkl_infos = load(self.ann_file, backend_args=self.backend_args) self.data_infos = self.convert_annos_to_kitti_annos(pkl_infos) result_dict, tmp_dir = self.format_results( results, diff --git a/mmdet3d/evaluation/metrics/lyft_metric.py b/mmdet3d/evaluation/metrics/lyft_metric.py index bfe767acab..e5cbfabbcc 100644 --- a/mmdet3d/evaluation/metrics/lyft_metric.py +++ b/mmdet3d/evaluation/metrics/lyft_metric.py @@ -46,21 +46,19 @@ class LyftMetric(BaseMetric): 'gpu'. Defaults to 'cpu'. """ - def __init__( - self, - data_root: str, - ann_file: str, - metric: Union[str, List[str]] = 'bbox', - modality=dict( - use_camera=False, - use_lidar=True, - ), - prefix: Optional[str] = None, - jsonfile_prefix: str = None, - csv_savepath: str = None, - collect_device: str = 'cpu', - file_client_args: dict = dict(backend='disk') - ) -> None: + def __init__(self, + data_root: str, + ann_file: str, + metric: Union[str, List[str]] = 'bbox', + modality=dict( + use_camera=False, + use_lidar=True, + ), + prefix: Optional[str] = None, + jsonfile_prefix: str = None, + csv_savepath: str = None, + collect_device: str = 'cpu', + backend_args: Optional[dict] = None) -> None: self.default_prefix = 'Lyft metric' super(LyftMetric, self).__init__( collect_device=collect_device, prefix=prefix) @@ -68,7 +66,7 @@ def __init__( self.data_root = data_root self.modality = modality self.jsonfile_prefix = jsonfile_prefix - self.file_client_args = file_client_args + self.backend_args = backend_args self.csv_savepath = csv_savepath self.metrics = metric if isinstance(metric, list) else [metric] @@ -115,7 +113,7 @@ def compute_metrics(self, results: list) -> Dict[str, float]: # load annotations self.data_infos = load( - self.ann_file, file_client_args=self.file_client_args)['data_list'] + self.ann_file, backend_args=self.backend_args)['data_list'] result_dict, tmp_dir = self.format_results(results, classes, self.jsonfile_prefix) diff --git a/mmdet3d/evaluation/metrics/nuscenes_metric.py b/mmdet3d/evaluation/metrics/nuscenes_metric.py index 77a95356f6..a09a3450c3 100644 --- a/mmdet3d/evaluation/metrics/nuscenes_metric.py +++ b/mmdet3d/evaluation/metrics/nuscenes_metric.py @@ -47,9 +47,8 @@ class NuScenesMetric(BaseMetric): collect_device (str): Device name used for collecting results from different ranks during distributed training. Must be 'cpu' or 'gpu'. Defaults to 'cpu'. - file_client_args (dict): Arguments to instantiate a FileClient. - See :class:`mmengine.fileio.FileClient` for details. - Defaults to dict(backend='disk'). + backend_args (dict, optional): Arguments to instantiate the + corresponding backend. Defaults to None. """ NameMapping = { 'movable_object.barrier': 'barrier', @@ -88,19 +87,17 @@ class NuScenesMetric(BaseMetric): 'attr_err': 'mAAE' } - def __init__( - self, - data_root: str, - ann_file: str, - metric: Union[str, List[str]] = 'bbox', - modality: dict = dict(use_camera=False, use_lidar=True), - prefix: Optional[str] = None, - format_only: bool = False, - jsonfile_prefix: Optional[str] = None, - eval_version: str = 'detection_cvpr_2019', - collect_device: str = 'cpu', - file_client_args: dict = dict(backend='disk') - ) -> None: + def __init__(self, + data_root: str, + ann_file: str, + metric: Union[str, List[str]] = 'bbox', + modality: dict = dict(use_camera=False, use_lidar=True), + prefix: Optional[str] = None, + format_only: bool = False, + jsonfile_prefix: Optional[str] = None, + eval_version: str = 'detection_cvpr_2019', + collect_device: str = 'cpu', + backend_args: Optional[dict] = None) -> None: self.default_prefix = 'NuScenes metric' super(NuScenesMetric, self).__init__( collect_device=collect_device, prefix=prefix) @@ -120,7 +117,7 @@ def __init__( 'the end.' self.jsonfile_prefix = jsonfile_prefix - self.file_client_args = file_client_args + self.backend_args = backend_args self.metrics = metric if isinstance(metric, list) else [metric] @@ -169,7 +166,7 @@ def compute_metrics(self, results: List[dict]) -> Dict[str, float]: self.version = self.dataset_meta['version'] # load annotations self.data_infos = load( - self.ann_file, file_client_args=self.file_client_args)['data_list'] + self.ann_file, backend_args=self.backend_args)['data_list'] result_dict, tmp_dir = self.format_results(results, classes, self.jsonfile_prefix) diff --git a/mmdet3d/evaluation/metrics/seg_metric.py b/mmdet3d/evaluation/metrics/seg_metric.py index d750854deb..0bd81e71e8 100644 --- a/mmdet3d/evaluation/metrics/seg_metric.py +++ b/mmdet3d/evaluation/metrics/seg_metric.py @@ -87,7 +87,7 @@ def format_results(self, results): ignore_index = self.dataset_meta['ignore_index'] # need to map network output to original label idx cat2label = np.zeros(len(self.dataset_meta['label2cat'])).astype( - np.int) + np.int64) for original_label, output_idx in self.dataset_meta['label2cat'].items( ): if output_idx != ignore_index: @@ -95,7 +95,7 @@ def format_results(self, results): for i, (eval_ann, result) in enumerate(results): sample_idx = eval_ann['point_cloud']['lidar_idx'] - pred_sem_mask = result['semantic_mask'].numpy().astype(np.int) + pred_sem_mask = result['semantic_mask'].numpy().astype(np.int64) pred_label = cat2label[pred_sem_mask] curr_file = f'{submission_prefix}/{sample_idx}.txt' np.savetxt(curr_file, pred_label, fmt='%d') diff --git a/mmdet3d/evaluation/metrics/waymo_metric.py b/mmdet3d/evaluation/metrics/waymo_metric.py index 5fae87412b..3b8e0d58c8 100644 --- a/mmdet3d/evaluation/metrics/waymo_metric.py +++ b/mmdet3d/evaluation/metrics/waymo_metric.py @@ -69,8 +69,8 @@ class WaymoMetric(KittiMetric): collect_device (str): Device name used for collecting results from different ranks during distributed training. Must be 'cpu' or 'gpu'. Defaults to 'cpu'. - file_client_args (dict): File client for reading gt in waymo format. - Defaults to ``dict(backend='disk')``. + backend_args (dict, optional): Arguments to instantiate the + corresponding backend. Defaults to None. idx2metainfo (str, optional): The file path of the metainfo in waymo. It stores the mapping from sample_idx to metainfo. The metainfo must contain the keys: 'idx2contextname' and 'idx2timestamp'. @@ -94,7 +94,7 @@ def __init__(self, default_cam_key: str = 'CAM_FRONT', use_pred_sample_idx: bool = False, collect_device: str = 'cpu', - file_client_args: dict = dict(backend='disk'), + backend_args: Optional[dict] = None, idx2metainfo: Optional[str] = None) -> None: self.waymo_bin_file = waymo_bin_file self.data_root = data_root @@ -117,7 +117,7 @@ def __init__(self, submission_prefix=submission_prefix, default_cam_key=default_cam_key, collect_device=collect_device, - file_client_args=file_client_args) + backend_args=backend_args) self.format_only = format_only if self.format_only: assert pklfile_prefix is not None, 'pklfile_prefix must be ' @@ -388,7 +388,7 @@ def format_results( waymo_results_final_path, prefix, classes, - file_client_args=self.file_client_args, + backend_args=self.backend_args, from_kitti_format=self.convert_kitti_format, idx2metainfo=self.idx2metainfo) converter.convert() diff --git a/mmdet3d/utils/misc.py b/mmdet3d/utils/misc.py index 91d7ac7d5f..e5f4b47d33 100644 --- a/mmdet3d/utils/misc.py +++ b/mmdet3d/utils/misc.py @@ -5,7 +5,7 @@ def replace_ceph_backend(cfg): cfg_pretty_text = cfg.pretty_text replace_strs = \ - r'''file_client_args = dict( + r'''backend_args = dict( backend='petrel', path_mapping=dict({ './data/DATA/': 's3://openmmlab/datasets/detection3d/CEPH/', @@ -49,6 +49,8 @@ def replace_ceph_backend(cfg): # cfg_pretty_text = cfg_pretty_text.replace( # 'ann_file', replace_strs + ', ann_file') + cfg_pretty_text = cfg_pretty_text.replace('backend_args=None', '') + # replace LoadImageFromFile cfg_pretty_text = cfg_pretty_text.replace( 'LoadImageFromFile\'', 'LoadImageFromFile\',' + replace_strs) @@ -80,6 +82,18 @@ def replace_ceph_backend(cfg): cfg_pretty_text = cfg_pretty_text.replace( 'LoadAnnotations3D\'', 'LoadAnnotations3D\',' + replace_strs) + # replace KittiMetric + cfg_pretty_text = cfg_pretty_text.replace('KittiMetric\'', + 'KittiMetric\',' + replace_strs) + + # replace LyftMetric + cfg_pretty_text = cfg_pretty_text.replace('LyftMetric\'', + 'LyftMetric\',' + replace_strs) + + # replace NuScenesMetric + cfg_pretty_text = cfg_pretty_text.replace( + 'NuScenesMetric\'', 'NuScenesMetric\',' + replace_strs) + # replace WaymoMetric cfg_pretty_text = cfg_pretty_text.replace('WaymoMetric\'', 'WaymoMetric\',' + replace_strs) diff --git a/projects/BEVFusion/bevfusion/loading.py b/projects/BEVFusion/bevfusion/loading.py index c8a93b673c..8615be7e3f 100644 --- a/projects/BEVFusion/bevfusion/loading.py +++ b/projects/BEVFusion/bevfusion/loading.py @@ -3,8 +3,8 @@ from typing import Optional import mmcv -import mmengine import numpy as np +from mmengine.fileio import get from mmdet3d.datasets.transforms import LoadMultiViewImageFromFiles from mmdet3d.registry import TRANSFORMS @@ -23,9 +23,8 @@ class BEVLoadMultiViewImageFromFiles(LoadMultiViewImageFromFiles): to_float32 (bool): Whether to convert the img to float32. Defaults to False. color_type (str): Color type of the file. Defaults to 'unchanged'. - file_client_args (dict): Arguments to instantiate a FileClient. - See :class:`mmengine.fileio.FileClient` for details. - Defaults to dict(backend='disk'). + backend_args (dict, optional): Arguments to instantiate the + corresponding backend. Defaults to None. num_views (int): Number of view in a frame. Defaults to 5. num_ref_frames (int): Number of frame in loading. Defaults to -1. test_mode (bool): Whether is test mode in loading. Defaults to False. @@ -160,12 +159,11 @@ def transform(self, results: dict) -> Optional[dict]: results['ori_cam2img'] = copy.deepcopy(results['cam2img']) - if self.file_client is None: - self.file_client = mmengine.FileClient(**self.file_client_args) - # img is of shape (h, w, c, num_views) # h and w can be different for different views - img_bytes = [self.file_client.get(name) for name in filename] + img_bytes = [ + get(name, backend_args=self.backend_args) for name in filename + ] imgs = [ mmcv.imfrombytes( img_byte, diff --git a/projects/BEVFusion/configs/bevfusion_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d.py b/projects/BEVFusion/configs/bevfusion_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d.py index 242ceb7916..8f12892372 100644 --- a/projects/BEVFusion/configs/bevfusion_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d.py +++ b/projects/BEVFusion/configs/bevfusion_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d.py @@ -27,7 +27,7 @@ CAM_BACK_LEFT='samples/CAM_BACK_LEFT', sweeps='sweeps/LIDAR_TOP') input_modality = dict(use_lidar=True, use_camera=True) -file_client_args = dict(backend='disk') +backend_args = None model = dict( type='BEVFusion', @@ -209,20 +209,24 @@ coord_type='LIDAR', load_dim=5, use_dim=[0, 1, 2, 3, 4], - reduce_beams=32)) + reduce_beams=32, + backend_args=backend_args), + backend_args=backend_args) train_pipeline = [ dict( type='BEVLoadMultiViewImageFromFiles', to_float32=True, - color_type='color'), + color_type='color', + backend_args=backend_args), dict( type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5, reduce_beams=32, - load_augmented=None), + load_augmented=None, + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=9, @@ -231,7 +235,8 @@ reduce_beams=32, pad_empty_sweeps=True, remove_close=True, - load_augmented=None), + load_augmented=None, + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=True, @@ -285,15 +290,22 @@ dict( type='BEVLoadMultiViewImageFromFiles', to_float32=True, - color_type='color'), - dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), + color_type='color', + backend_args=backend_args), + dict( + type='LoadPointsFromFile', + coord_type='LIDAR', + load_dim=5, + use_dim=5, + backend_args=backend_args), dict( type='LoadPointsFromMultiSweeps', sweeps_num=9, load_dim=5, use_dim=5, pad_empty_sweeps=True, - remove_close=True), + remove_close=True, + backend_args=backend_args), dict( type='ImageAug3D', final_dim=[256, 704], @@ -331,7 +343,8 @@ data_prefix=data_prefix, # we use box_type_3d='LiDAR' in kitti and nuscenes dataset # and box_type_3d='Depth' in sunrgbd and scannet dataset. - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) val_dataloader = dict( batch_size=1, num_workers=0, @@ -347,14 +360,16 @@ modality=input_modality, data_prefix=data_prefix, test_mode=True, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) test_dataloader = val_dataloader val_evaluator = dict( type='NuScenesMetric', data_root=data_root, ann_file=data_root + 'nuscenes_infos_val.pkl', - metric='bbox') + metric='bbox', + backend_args=backend_args) test_evaluator = val_evaluator vis_backends = [dict(type='LocalVisBackend')] diff --git a/projects/CenterFormer/configs/centerformer_voxel01_second-attn_secfpn-attn_4xb4-cyclic-20e_waymoD5-3d-3class.py b/projects/CenterFormer/configs/centerformer_voxel01_second-attn_secfpn-attn_4xb4-cyclic-20e_waymoD5-3d-3class.py index df19f3c6a6..22a71521d9 100644 --- a/projects/CenterFormer/configs/centerformer_voxel01_second-attn_secfpn-attn_4xb4-cyclic-20e_waymoD5-3d-3class.py +++ b/projects/CenterFormer/configs/centerformer_voxel01_second-attn_secfpn-attn_4xb4-cyclic-20e_waymoD5-3d-3class.py @@ -13,7 +13,7 @@ tasks = [dict(num_class=3, class_names=['car', 'pedestrian', 'cyclist'])] metainfo = dict(classes=class_names) input_modality = dict(use_lidar=True, use_camera=False) -file_client_args = dict(backend='disk') +backend_args = None model = dict( type='CenterFormer', @@ -120,7 +120,9 @@ type='LoadPointsFromFile', coord_type='LIDAR', load_dim=6, - use_dim=[0, 1, 2, 3, 4])) + use_dim=[0, 1, 2, 3, 4], + backend_args=backend_args), + backend_args=backend_args) train_pipeline = [ dict( @@ -128,7 +130,8 @@ coord_type='LIDAR', load_dim=6, use_dim=5, - norm_intensity=True), + norm_intensity=True, + backend_args=backend_args), # Add this if using `MultiFrameDeformableDecoderRPN` # dict( # type='LoadPointsFromMultiSweeps', @@ -160,7 +163,7 @@ load_dim=6, use_dim=5, norm_intensity=True, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), @@ -199,7 +202,7 @@ box_type_3d='LiDAR', # load one frame every five frames load_interval=5, - file_client_args=file_client_args)) + backend_args=backend_args)) val_dataloader = dict( batch_size=1, num_workers=1, @@ -216,7 +219,7 @@ test_mode=True, metainfo=metainfo, box_type_3d='LiDAR', - file_client_args=file_client_args)) + backend_args=backend_args)) test_dataloader = val_dataloader val_evaluator = dict( @@ -224,7 +227,7 @@ ann_file='./data/waymo/kitti_format/waymo_infos_val.pkl', waymo_bin_file='./data/waymo/waymo_format/gt.bin', data_root='./data/waymo/waymo_format', - file_client_args=file_client_args, + backend_args=backend_args, convert_kitti_format=False, idx2metainfo='./data/waymo/waymo_format/idx2metainfo.pkl') test_evaluator = val_evaluator diff --git a/projects/DETR3D/configs/detr3d_r101_gridmask.py b/projects/DETR3D/configs/detr3d_r101_gridmask.py index 0cea8a8f2a..522644ca5b 100644 --- a/projects/DETR3D/configs/detr3d_r101_gridmask.py +++ b/projects/DETR3D/configs/detr3d_r101_gridmask.py @@ -128,9 +128,13 @@ ] train_transforms = [dict(type='PhotoMetricDistortion3D')] + test_transforms -file_client_args = dict(backend='disk') +backend_args = None train_pipeline = [ - dict(type='LoadMultiViewImageFromFiles', to_float32=True, num_views=6), + dict( + type='LoadMultiViewImageFromFiles', + to_float32=True, + num_views=6, + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=True, @@ -143,7 +147,11 @@ ] test_pipeline = [ - dict(type='LoadMultiViewImageFromFiles', to_float32=True, num_views=6), + dict( + type='LoadMultiViewImageFromFiles', + to_float32=True, + num_views=6, + backend_args=backend_args), dict(type='MultiViewWrapper', transforms=test_transforms), dict(type='Pack3DDetInputs', keys=['img']) ] @@ -176,7 +184,8 @@ data_prefix=data_prefix, # we use box_type_3d='LiDAR' in kitti and nuscenes dataset # and box_type_3d='Depth' in sunrgbd and scannet dataset. - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) val_dataloader = dict( batch_size=1, @@ -194,7 +203,8 @@ modality=input_modality, test_mode=True, data_prefix=data_prefix, - box_type_3d='LiDAR')) + box_type_3d='LiDAR', + backend_args=backend_args)) test_dataloader = val_dataloader @@ -202,7 +212,8 @@ type='NuScenesMetric', data_root=data_root, ann_file=data_root + 'nuscenes_infos_val.pkl', - metric='bbox') + metric='bbox', + backend_args=backend_args) test_evaluator = val_evaluator optim_wrapper = dict( diff --git a/projects/PETR/config/petr/petr_vovnet_gridmask_p4_800x320.py b/projects/PETR/config/petr/petr_vovnet_gridmask_p4_800x320.py index 06898307e1..5cec19400c 100644 --- a/projects/PETR/config/petr/petr_vovnet_gridmask_p4_800x320.py +++ b/projects/PETR/config/petr/petr_vovnet_gridmask_p4_800x320.py @@ -115,7 +115,7 @@ dataset_type = 'NuScenesDataset' data_root = 'data/nuscenes/' -file_client_args = dict(backend='disk') +backend_args = None db_sampler = dict( data_root=data_root, @@ -150,7 +150,9 @@ type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, - use_dim=[0, 1, 2, 3, 4])) + use_dim=[0, 1, 2, 3, 4], + backend_args=backend_args), + backend_args=backend_args) ida_aug_conf = { 'resize_lim': (0.47, 0.625), 'final_dim': (320, 800), @@ -162,7 +164,10 @@ } train_pipeline = [ - dict(type='LoadMultiViewImageFromFiles', to_float32=True), + dict( + type='LoadMultiViewImageFromFiles', + to_float32=True, + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=True, @@ -187,7 +192,10 @@ ]) ] test_pipeline = [ - dict(type='LoadMultiViewImageFromFiles', to_float32=True), + dict( + type='LoadMultiViewImageFromFiles', + to_float32=True, + backend_args=backend_args), dict( type='ResizeCropFlipImage', data_aug_conf=ida_aug_conf, training=False), @@ -212,7 +220,8 @@ metainfo=metainfo, test_mode=False, modality=input_modality, - use_valid_flag=True)) + use_valid_flag=True, + backend_args=backend_args)) test_dataloader = dict( dataset=dict( type=dataset_type, @@ -229,7 +238,8 @@ metainfo=metainfo, test_mode=True, modality=input_modality, - use_valid_flag=True)) + use_valid_flag=True, + backend_args=backend_args)) val_dataloader = dict( dataset=dict( type=dataset_type, @@ -246,7 +256,8 @@ metainfo=metainfo, test_mode=True, modality=input_modality, - use_valid_flag=True)) + use_valid_flag=True, + backend_args=backend_args)) # Different from original PETR: # We don't use special lr for image_backbone diff --git a/requirements/mminstall.txt b/requirements/mminstall.txt index 93d132d036..0f8afd34c1 100644 --- a/requirements/mminstall.txt +++ b/requirements/mminstall.txt @@ -1,3 +1,3 @@ mmcv>=2.0.0rc4,<2.1.0 mmdet>=3.0.0rc0,<3.1.0 -mmengine>=0.4.0,<1.0.0 +mmengine>=0.6.0,<1.0.0 diff --git a/requirements/readthedocs.txt b/requirements/readthedocs.txt index c24722a876..4781e08577 100644 --- a/requirements/readthedocs.txt +++ b/requirements/readthedocs.txt @@ -1,5 +1,5 @@ -mmcv>=2.0.0rc0 +mmcv>=2.0.0rc4 mmdet>=3.0.0rc0 -mmengine>=0.1.0 +mmengine>=0.6.0 torch torchvision diff --git a/requirements/runtime.txt b/requirements/runtime.txt index 16ec2ffc90..c0e8c19be3 100644 --- a/requirements/runtime.txt +++ b/requirements/runtime.txt @@ -8,4 +8,4 @@ plyfile scikit-image # by default we also use tensorboard to log results tensorboard -trimesh>=2.35.39,<2.35.40 +trimesh diff --git a/tests/test_datasets/test_transforms/test_loading.py b/tests/test_datasets/test_transforms/test_loading.py index a5d4109984..d071223580 100644 --- a/tests/test_datasets/test_transforms/test_loading.py +++ b/tests/test_datasets/test_transforms/test_loading.py @@ -16,12 +16,12 @@ class TestLoadPointsFromFile(unittest.TestCase): def test_load_points_from_file(self): use_dim = 3 - file_client_args = dict(backend='disk') + backend_args = None load_points_transform = LoadPointsFromFile( coord_type='LIDAR', load_dim=4, use_dim=use_dim, - file_client_args=file_client_args) + backend_args=backend_args) data_info = create_dummy_data_info() info = load_points_transform(data_info) self.assertIn('points', info) @@ -30,7 +30,7 @@ def test_load_points_from_file(self): coord_type='DEPTH', load_dim=4, use_dim=use_dim, - file_client_args=file_client_args) + backend_args=backend_args) info = load_points_transform(data_info) self.assertIsInstance(info['points'], DepthPoints) self.assertEqual(info['points'].shape[-1], use_dim) @@ -39,7 +39,7 @@ def test_load_points_from_file(self): load_dim=4, use_dim=use_dim, shift_height=True, - file_client_args=file_client_args) + backend_args=backend_args) info = load_points_transform(data_info) # extra height dim self.assertEqual(info['points'].shape[-1], use_dim + 1) @@ -53,7 +53,7 @@ def test_load_points_from_file(self): class TestLoadAnnotations3D(unittest.TestCase): def test_load_points_from_file(self): - file_client_args = dict(backend='disk') + backend_args = None load_anns_transform = LoadAnnotations3D( with_bbox_3d=True, @@ -62,7 +62,7 @@ def test_load_points_from_file(self): seg_offset=2**16, dataset_type='semantickitti', seg_3d_dtype='np.uint32', - file_client_args=file_client_args) + backend_args=backend_args) self.assertIs(load_anns_transform.with_seg, False) self.assertIs(load_anns_transform.with_bbox_3d, True) self.assertIs(load_anns_transform.with_label_3d, True) diff --git a/tests/test_evaluation/test_functional/test_instance_seg_eval.py b/tests/test_evaluation/test_functional/test_instance_seg_eval.py index 15a01ac377..89f93dca37 100644 --- a/tests/test_evaluation/test_functional/test_instance_seg_eval.py +++ b/tests/test_evaluation/test_functional/test_instance_seg_eval.py @@ -21,9 +21,9 @@ def test_instance_seg_eval(): pred_instance_labels = [] pred_instance_scores = [] for n_points, gt_labels in zip(n_points_list, gt_labels_list): - gt_instance_mask = np.ones(n_points, dtype=np.int) * -1 - gt_semantic_mask = np.ones(n_points, dtype=np.int) * -1 - pred_instance_mask = np.ones(n_points, dtype=np.int) * -1 + gt_instance_mask = np.ones(n_points, dtype=np.int64) * -1 + gt_semantic_mask = np.ones(n_points, dtype=np.int64) * -1 + pred_instance_mask = np.ones(n_points, dtype=np.int64) * -1 labels = [] scores = [] for i, gt_label in enumerate(gt_labels): diff --git a/tests/test_evaluation/test_metrics/test_instance_seg_metric.py b/tests/test_evaluation/test_metrics/test_instance_seg_metric.py index dc94c1232c..1ae1dcedbe 100644 --- a/tests/test_evaluation/test_metrics/test_instance_seg_metric.py +++ b/tests/test_evaluation/test_metrics/test_instance_seg_metric.py @@ -16,8 +16,8 @@ def _demo_mm_model_output(self): n_points = 3300 gt_labels = [0, 0, 0, 0, 0, 0, 14, 14, 2, 1] - gt_instance_mask = np.ones(n_points, dtype=np.int) * -1 - gt_semantic_mask = np.ones(n_points, dtype=np.int) * -1 + gt_instance_mask = np.ones(n_points, dtype=np.int64) * -1 + gt_semantic_mask = np.ones(n_points, dtype=np.int64) * -1 for i, gt_label in enumerate(gt_labels): begin = i * 300 end = begin + 300 @@ -31,7 +31,7 @@ def _demo_mm_model_output(self): results_dict = dict() n_points = 3300 gt_labels = [0, 0, 0, 0, 0, 0, 14, 14, 2, 1] - pred_instance_mask = np.ones(n_points, dtype=np.int) * -1 + pred_instance_mask = np.ones(n_points, dtype=np.int64) * -1 labels = [] scores = [] for i, gt_label in enumerate(gt_labels): diff --git a/tests/test_structures/test_ops/test_box_np_ops.py b/tests/test_structures/test_ops/test_box_np_ops.py index bca39ae6ad..2ce6cf6cee 100644 --- a/tests/test_structures/test_ops/test_box_np_ops.py +++ b/tests/test_structures/test_ops/test_box_np_ops.py @@ -72,12 +72,12 @@ def test_points_in_convex_polygon_jit(): [[1.0, 0.0], [1.0, 1.0], [0.5, 1.0], [0.0, 1.0]], [[1.0, 0.0], [0.0, 1.0], [-1.0, 0.0], [0.0, -1.0]]]) res = points_in_convex_polygon_jit(points, polygons) - expected_res = np.array([[1, 0, 1], [0, 0, 0], [0, 1, 0]]).astype(np.bool) + expected_res = np.array([[1, 0, 1], [0, 0, 0], [0, 1, 0]]).astype(bool) assert np.allclose(res, expected_res) polygons = np.array([[[0.0, 0.0], [0.0, 1.0], [0.5, 0.5], [1.0, 0.0]], [[0.0, 1.0], [1.0, 1.0], [1.0, 0.5], [1.0, 0.0]], [[1.0, 0.0], [0.0, -1.0], [-1.0, 0.0], [0.0, 1.1]]]) res = points_in_convex_polygon_jit(points, polygons, clockwise=True) - expected_res = np.array([[1, 0, 1], [0, 0, 1], [0, 1, 0]]).astype(np.bool) + expected_res = np.array([[1, 0, 1], [0, 0, 1], [0, 1, 0]]).astype(bool) assert np.allclose(res, expected_res) diff --git a/tools/dataset_converters/create_gt_database.py b/tools/dataset_converters/create_gt_database.py index 29e9001029..e0073954a3 100644 --- a/tools/dataset_converters/create_gt_database.py +++ b/tools/dataset_converters/create_gt_database.py @@ -147,7 +147,7 @@ def create_groundtruth_database(dataset_class_name, dataset_cfg = dict( type=dataset_class_name, data_root=data_path, ann_file=info_path) if dataset_class_name == 'KittiDataset': - file_client_args = dict(backend='disk') + backend_args = None dataset_cfg.update( modality=dict( use_lidar=True, @@ -161,12 +161,12 @@ def create_groundtruth_database(dataset_class_name, coord_type='LIDAR', load_dim=4, use_dim=4, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True, - file_client_args=file_client_args) + backend_args=backend_args) ]) elif dataset_class_name == 'NuScenesDataset': @@ -193,7 +193,7 @@ def create_groundtruth_database(dataset_class_name, ]) elif dataset_class_name == 'WaymoDataset': - file_client_args = dict(backend='disk') + backend_args = None dataset_cfg.update( test_mode=False, data_prefix=dict( @@ -210,12 +210,12 @@ def create_groundtruth_database(dataset_class_name, coord_type='LIDAR', load_dim=6, use_dim=6, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True, - file_client_args=file_client_args) + backend_args=backend_args) ]) dataset = DATASETS.build(dataset_cfg) @@ -510,7 +510,7 @@ def create(self): data_root=self.data_path, ann_file=self.info_path) if self.dataset_class_name == 'KittiDataset': - file_client_args = dict(backend='disk') + backend_args = None dataset_cfg.update( test_mode=False, data_prefix=dict( @@ -527,12 +527,12 @@ def create(self): coord_type='LIDAR', load_dim=4, use_dim=4, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True, - file_client_args=file_client_args) + backend_args=backend_args) ]) elif self.dataset_class_name == 'NuScenesDataset': @@ -560,7 +560,7 @@ def create(self): ]) elif self.dataset_class_name == 'WaymoDataset': - file_client_args = dict(backend='disk') + backend_args = None dataset_cfg.update( test_mode=False, data_prefix=dict( @@ -579,12 +579,12 @@ def create(self): coord_type='LIDAR', load_dim=6, use_dim=6, - file_client_args=file_client_args), + backend_args=backend_args), dict( type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True, - file_client_args=file_client_args) + backend_args=backend_args) ]) self.dataset = DATASETS.build(dataset_cfg) diff --git a/tools/dataset_converters/kitti_data_utils.py b/tools/dataset_converters/kitti_data_utils.py index f871d33cd8..64c3bc415b 100644 --- a/tools/dataset_converters/kitti_data_utils.py +++ b/tools/dataset_converters/kitti_data_utils.py @@ -594,9 +594,9 @@ def add_difficulty_to_annos(info): occlusion = annos['occluded'] truncation = annos['truncated'] diff = [] - easy_mask = np.ones((len(dims), ), dtype=np.bool) - moderate_mask = np.ones((len(dims), ), dtype=np.bool) - hard_mask = np.ones((len(dims), ), dtype=np.bool) + easy_mask = np.ones((len(dims), ), dtype=bool) + moderate_mask = np.ones((len(dims), ), dtype=bool) + hard_mask = np.ones((len(dims), ), dtype=bool) i = 0 for h, o, t in zip(height, occlusion, truncation): if o > max_occlusion[0] or h <= min_height[0] or t > max_trunc[0]: diff --git a/tools/dataset_converters/s3dis_data_utils.py b/tools/dataset_converters/s3dis_data_utils.py index b36e07f545..d7a76a9750 100644 --- a/tools/dataset_converters/s3dis_data_utils.py +++ b/tools/dataset_converters/s3dis_data_utils.py @@ -78,8 +78,10 @@ def process_single_scene(sample_idx): f'{self.split}_{sample_idx}_sem_label.npy') points = np.load(pts_filename).astype(np.float32) - pts_instance_mask = np.load(pts_instance_mask_path).astype(np.int) - pts_semantic_mask = np.load(pts_semantic_mask_path).astype(np.int) + pts_instance_mask = np.load(pts_instance_mask_path).astype( + np.int64) + pts_semantic_mask = np.load(pts_semantic_mask_path).astype( + np.int64) mmengine.mkdir_or_exist(osp.join(self.root_dir, 'points')) mmengine.mkdir_or_exist(osp.join(self.root_dir, 'instance_mask')) @@ -180,8 +182,8 @@ def __init__(self, 12]) # used for seg task self.ignore_index = len(self.cat_ids) - self.cat_id2class = np.ones((self.all_ids.shape[0],), dtype=np.int) * \ - self.ignore_index + self.cat_id2class = np.ones( + (self.all_ids.shape[0], ), dtype=np.int64) * self.ignore_index for i, cat_id in enumerate(self.cat_ids): self.cat_id2class[cat_id] = i diff --git a/tools/dataset_converters/scannet_data_utils.py b/tools/dataset_converters/scannet_data_utils.py index 5ee275454b..d03c2208fe 100644 --- a/tools/dataset_converters/scannet_data_utils.py +++ b/tools/dataset_converters/scannet_data_utils.py @@ -232,8 +232,8 @@ def __init__(self, ]) # used for seg task self.ignore_index = len(self.cat_ids) - self.cat_id2class = np.ones((self.all_ids.shape[0],), dtype=np.int) * \ - self.ignore_index + self.cat_id2class = np.ones( + (self.all_ids.shape[0], ), dtype=np.int64) * self.ignore_index for i, cat_id in enumerate(self.cat_ids): self.cat_id2class[cat_id] = i