text: # model settings
  point_cloud_range = [-80, -80, -5, 80, 80, 3]   # x y z x y z
  voxel_size = [0.1, 0.1, 0.2] # x y z
  model = dict(
      type='CenterPoint',
      pts_voxel_layer=dict(
          max_num_points=10, voxel_size=voxel_size, max_voxels=(90000, 120000), point_cloud_range=point_cloud_range),
      pts_voxel_encoder=dict(type='HardSimpleVFE', num_features=4),
      pts_middle_encoder=dict(
          type='SparseEncoder',
          in_channels=4,
          sparse_shape=[41, 1600, 1600],
          output_channels=128,
          order=('conv', 'norm', 'act'),
          encoder_channels=((16, 16, 32), (32, 32, 64), (64, 64, 128), (128,
                                                                        128)),
          encoder_paddings=((0, 0, 1), (0, 0, 1), (0, 0, [0, 1, 1]), (0, 0)),
          block_type='basicblock'
          ),
      pts_backbone=dict(
          type='SECOND',
          in_channels=256,
          out_channels=[128, 256],
          layer_nums=[5, 5],
          layer_strides=[1, 2],
          norm_cfg=dict(type='BN', eps=1e-3, momentum=0.01),
          conv_cfg=dict(type='Conv2d', bias=False)
          ),
      pts_neck=dict(
          type='SECONDFPN',
          in_channels=[128, 256],
          out_channels=[256, 256],
          upsample_strides=[1, 2],
          norm_cfg=dict(type='BN', eps=1e-3, momentum=0.01),
          upsample_cfg=dict(type='deconv', bias=False),
          use_conv_for_no_stride=True
          ),
      pts_bbox_head=dict(
          type='CenterHead',
          in_channels=sum([256, 256]),
          tasks=[
              dict(num_class=1, class_names=['car', 'van']),
              dict(num_class=3, class_names=['truck', 'big_truck', 'bus']),
              dict(num_class=2, class_names=['pedestrian','cyclist', 'tricycle', 'cone']),
          ],
          common_heads=dict(
              reg=(2, 2), height=(1, 2), dim=(3, 2), rot=(2, 2)),
          share_conv_channel=64,
          bbox_coder=dict(
              type='CenterPointBBoxCoder',
              pc_range=point_cloud_range[:2],
              post_center_range=[-80, -80, -10.0, 80, 80, 10.0],
              max_num=500,
              score_threshold=0.1,
              out_size_factor=8,
              voxel_size=voxel_size[:2],
              code_size=7),
          separate_head=dict(
              type='SeparateHead', init_bias=-2.19, final_kernel=3),
          loss_cls=dict(type='GaussianFocalLoss', reduction='mean'),
          loss_bbox=dict(type='L1Loss', reduction='mean', loss_weight=0.25),
          norm_bbox=True,
          ),
      # model training and testing settings
      train_cfg=dict(
          pts=dict(
              grid_size=[1600, 1600, 40],
              voxel_size=voxel_size,
              out_size_factor=8,
              dense_reg=1,
              gaussian_overlap=0.1,
              max_objs=500,
              min_radius=2,
              code_weights=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
              point_cloud_range=point_cloud_range)
          ),
      test_cfg=dict(
          pts=dict(
              post_center_limit_range=[-80, -80, -10.0, 80, 80, 10.0],
              max_per_img=500,
              max_pool_nms=False,
              min_radius=[4, 12, 3, 1],
              score_threshold=0.1,
              out_size_factor=8,
              voxel_size=voxel_size[:2],
              nms_type='rotate',
              pre_max_size=1000,
              post_max_size=83,
              nms_thr=0.2,
              pc_range=point_cloud_range[:2],
              # use_rotate_nms=True,
              # max_num=83,
              ),
          )
  )
  
  
  # dataset settings
  dataset_type = 'DeeprouteDataset'
  data_root = 'data/deeproute_competition/'
  
  class_names=[
              'CAR',
              'VAN',
              'TRUCK',
              'BIG_TRUCK',
              'BUS',
              'PEDESTRIAN',
              'CYCLIST',
              'TRICYCLE',
              'CONE']
  
  
  input_modality = dict(use_lidar=True, use_camera=False)
  db_sampler = dict(
      data_root=data_root,
      info_path=data_root + 'training/instance_infos.pkl',
      rate=1.0,
      prepare=dict(
          filter_by_difficulty=[-1],
          filter_by_min_points=dict(
              CAR=5,
              VAN=5,
              TRUCK=5,
              BIG_TRUCK=5,
              BUS=5,
              PEDESTRIAN=5,
              CYCLIST=5,
              TRICYCLE=5,
              CONE=5,
          )),
      classes=class_names,
      sample_groups=dict(
          CAR=5,
          VAN=15,
          TRUCK=15,
          BIG_TRUCK=20,
          BUS=15,
          PEDESTRIAN=10,
          CYCLIST=15,
          TRICYCLE=20,
          CONE=15,
      ))
  
  train_pipeline = [
      dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4),
      dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True),
      dict(type='ObjectSample', db_sampler=db_sampler),
      dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5),
      dict(
          type='GlobalRotScaleTrans',
          rot_range=[-0.78539816, 0.78539816],
          scale_ratio_range=[0.95, 1.05]),
      dict(type='PointsRangeFilter', point_cloud_range=point_cloud_range),
      dict(type='ObjectRangeFilter', point_cloud_range=point_cloud_range),
      dict(type='PointShuffle'),
      dict(type='DefaultFormatBundle3D', class_names=class_names),
      dict(type='Collect3D', keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']),
  ]
  
  
  # test_pipeline = [
  #     dict(
  #         type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4),
  #     dict(
  #         type='MultiScaleFlipAug3D',
  #         img_scale=(1333, 800),
  #         pts_scale_ratio=[0.95, 1.0, 1.05],
  #         flip=True,
  #         pcd_horizontal_flip=True,
  #         pcd_vertical_flip=True,
  #         transforms=[
  #             dict(
  #                 type='GlobalRotScaleTrans',
  #                 rot_range=[0, 0],
  #                 scale_ratio_range=[1., 1.],
  #                 translation_std=[0, 0, 0]),
  #             dict(type='RandomFlip3D', sync_2d=False),
  #             dict(
  #                 type='PointsRangeFilter', point_cloud_range=point_cloud_range),
  #             dict(
  #                 type='DefaultFormatBundle3D',
  #                 class_names=class_names,
  #                 with_label=False),
  #             dict(type='Collect3D', keys=['points'])
  #         ])
  # ]
  
  test_pipeline = [
      dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=4, use_dim=4),
      dict(
          type='MultiScaleFlipAug3D',
          img_scale=(1333, 800),
          pts_scale_ratio=1,
          flip=True,
          transforms=[
              dict(
                  type='GlobalRotScaleTrans',
                  # rot_range=[-0.78539816, 0.78539816],
                  #rot_range=[-0, 0],
                  # scale_ratio_range=[0.95, 1.05],
                  # scale_ratio_range=[1.0, 1.0],
                  translation_std=[0, 0, 0]),
              dict(type='RandomFlip3D'),
              dict(
                  type='PointsRangeFilter', point_cloud_range=point_cloud_range),
              dict(
                  type='DefaultFormatBundle3D',
                  class_names=class_names,
                  with_label=False),
              dict(type='Collect3D', keys=['points'])
          ])
  ]
  # 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='DefaultFormatBundle3D',
          class_names=class_names,
          with_label=False),
      dict(type='Collect3D', keys=['points'])
  ]
  
  data = dict(
      samples_per_gpu=2,
      workers_per_gpu=4,
      train=dict(
          type=dataset_type,
          data_root=data_root,
          ann_file=data_root + 'kitti_infos_train.pkl',
          split='training',
          pts_prefix='velodyne_reduced',
          pipeline=train_pipeline,
          modality=input_modality,
          classes=class_names,
          test_mode=False),
      val=dict(
          type=dataset_type,
          data_root=data_root,
          ann_file=data_root + 'kitti_infos_val.pkl',
          split='training',
          pts_prefix='velodyne_reduced',
          pipeline=test_pipeline,
          modality=input_modality,
          classes=class_names,
          test_mode=True,
          valid_mode=True,),
      test=dict(
          type=dataset_type,
          data_root=data_root,
          ann_file=data_root + 'kitti_infos_val.pkl',
          split='training',
          pts_prefix='velodyne_reduced',
          pipeline=test_pipeline,
          modality=input_modality,
          classes=class_names,
          test_mode=True,
          valid_mode=True))
  # optimizer
  lr = 0.0003  # max learning rate
  optimizer = dict(
      type='AdamW',
      lr=lr,
      betas=(0.95, 0.99),  # the momentum is change during training
      weight_decay=0.01)
  optimizer_config = dict(grad_clip=dict(max_norm=10, norm_type=2))
  # learning policy
  lr_config = dict(
      policy='cyclic',
      target_ratio=(10, 1e-4),
      cyclic_times=1,
      step_ratio_up=0.4)
  momentum_config = dict(
      policy='cyclic',
      target_ratio=(0.85 / 0.95, 1),
      cyclic_times=1,
      step_ratio_up=0.4)
  checkpoint_config = dict(interval=1)
  evaluation = dict(interval=1, pipeline=test_pipeline)
  # yapf:disable
  log_config = dict(
      interval=50,
      hooks=[
          dict(type='TextLoggerHook'),
          dict(type='TensorboardLoggerHook')
      ])
  # yapf:enable
  # runtime settings
  runner = dict(type='EpochBasedRunner', max_epochs=80)
  dist_params = dict(backend='nccl')
  log_level = 'INFO'
  work_dir = './work_dirs/data_aug2'
  load_from = None  # './models/centerpoint.pth'
  resume_from = None  # './work_dirs/data_aug/latest.pth'
  workflow = [('train', 1)]
  