HEAL icon indicating copy to clipboard operation
HEAL copied to clipboard

How can I train a road-based model using only the road-point cloud of dair-v2x?

Open KKHAOO opened this issue 1 year ago • 3 comments
trafficstars

How can I train a road-based model using only the road-point cloud of dair-v2x?

KKHAOO avatar Jul 07 '24 05:07 KKHAOO

Hi! You can get started with this yaml(opencood/hypes_yaml/dairv2x/Single/DAIR_single_m1.yaml). The input_source: ['camera','lidar'] includes 2 modalities, but it is okay. The camera data will not used actually.

To only use the road-side unit data, you should change 2 parts in existing code.

  1. you should change the random selection this line to only selecting RSU agent. The cav_id is 0 for the vehicle and 1 for the RSU.
            if not self.visualize:
                options = []
                for cav_id, cav_content in base_data_dict.items():
                    if cav_content['modality_name'] in self.ego_modality:
                        options.append(cav_id)
                selected_cav_base = base_data_dict[random.choice(options)] # change this line to only select RSU agent.
            else:
                selected_cav_id, selected_cav_base = list(base_data_dict.items())[0]
  1. There is an augmentation which permute the cav_id of vehicle and RSU in DAIR-V2X's basedataset code. To make sure cav_id is 0 for the vehicle and 1 for the RSU, you can simply remove those lines.
            if self.train: # randomly choose RSU or Veh to be Ego
                p = np.random.rand()
                if p > 0.5:
                    data[0], data[1] = data[1], data[0]
                    data[0]['ego'] = True
                    data[1]['ego'] = False
            else:
                # evaluate, the agent of ego modality should be ego
                if self.adaptor.mapping_dict[data[0]['modality_name']] not in self.ego_modality and \
                    self.adaptor.mapping_dict[data[1]['modality_name']] in self.ego_modality:
                    data[0], data[1] = data[1], data[0]
                    data[0]['ego'] = True
                    data[1]['ego'] = False

yifanlu0227 avatar Jul 07 '24 12:07 yifanlu0227

I modified these two parts according to your method. Firstly, I modified the first step you mentioned selected_cav_base = base_data_dict[random.choice(options)] to selected_cav_base = base_data_dict[1], but the visualization result shows the vehicle-side detection results. Therefore, I modified the get_item_test function.I change this line if cav_content['ego']: to if cav_content['ego']==False: ,The final visualization result became the roadside detection results, but there are some issues with the GT boxes. These issues mainly include the following two aspects:

  1. There are some gt boxes outside the range of the point cloud that shouldn't be there. I checked the gt boxes after vehicle-road collaboration, and it seems these extra boxes belong to the vehicle-side. bev_00120
  2. Some vehicles are not labeled with GT boxes." bev_00440(1)

KKHAOO avatar Jul 11 '24 06:07 KKHAOO

Do you know how to solve these problems?

KKHAOO avatar Jul 12 '24 08:07 KKHAOO