# Exercise C2-3-2 : Transform metric point coordinates to BEV space
        l2_exercises.pcl_to_bev(cropped_pcl, configs)

        # Example C2-3-3 : Minimum and maximum intensity
        # l2_examples.min_max_intensity(lidar_pcl)

        # Example C2-4-2 : count total no. of vehicles and vehicles that are difficult to track
        # l2_examples.count_vehicles(frame)

        # Example C2-4-3 : Display label bounding boxes on top of BEV map
        # lidar_bev = load_object_from_file(results_fullpath, data_filename, 'lidar_bev', cnt_frame)
        # lidar_bev_labels = l2_examples.render_bb_over_bev(lidar_bev, frame.laser_labels, configs)

        # Example C2-4-4 : Display detected objects on top of BEV map
        detections = load_object_from_file(
            results_fullpath, data_filename,
            'detections_' + configs.model + '_' + str(configs.conf_thresh),
            cnt_frame)
        l2_examples.render_obj_over_bev(detections, lidar_bev_labels, configs,
                                        True)

        # Exercise C2-4-5 : Compute precision and recall (part 1/2 - remove comments only, no action inside functions required)
        det_performance = load_object_from_file(
            results_fullpath, data_filename, 'det_performance_' +
            configs.model + '_' + str(configs.conf_thresh), cnt_frame)
        det_performance_all.append(
            det_performance
        )  # store all evaluation results in a list for performance assessme

        #######
        ####### LESSON 2 EXERCISES & EXAMPLES  END #######
Exemplo n.º 2
0
        lidar_name = dataset_pb2.LaserName.TOP
        camera_name = dataset_pb2.CameraName.FRONT
        lidar_calibration = waymo_utils.get(frame.context.laser_calibrations,
                                            lidar_name)
        camera_calibration = waymo_utils.get(frame.context.camera_calibrations,
                                             camera_name)
        if 'load_image' in exec_list:
            image = tools.extract_front_camera_image(frame)

        ## Compute lidar point-cloud from range image
        if 'pcl_from_rangeimage' in exec_list:
            print('computing point-cloud from lidar range image')
            lidar_pcl = tools.pcl_from_range_image(frame, lidar_name)
        else:
            print('loading lidar point-cloud from result file')
            lidar_pcl = load_object_from_file(results_fullpath, data_filename,
                                              'lidar_pcl', cnt_frame)

        ## Compute lidar birds-eye view (bev)
        if 'bev_from_pcl' in exec_list:
            print('computing birds-eye view from lidar pointcloud')
            lidar_bev = pcl.bev_from_pcl(lidar_pcl, configs_det)
        else:
            print('loading birds-eve view from result file')
            lidar_bev = load_object_from_file(results_fullpath, data_filename,
                                              'lidar_bev', cnt_frame)

        ## 3D object detection
        if (configs_det.use_labels_as_objects == True):
            print('using groundtruth labels as objects')
            detections = tools.convert_labels_into_objects(
                frame.laser_labels, configs_det)
Exemplo n.º 3
0
        lidar_name = dataset_pb2.LaserName.TOP
        camera_name = dataset_pb2.CameraName.FRONT
        lidar_calibration = waymo_utils.get(frame.context.laser_calibrations,
                                            lidar_name)
        camera_calibration = waymo_utils.get(frame.context.camera_calibrations,
                                             camera_name)
        if 'load_image' in exec_list:
            image = tools.extract_front_camera_image(frame)

        ## Compute lidar point-cloud from range image
        if 'pcl_from_rangeimage' in exec_list:
            print('computing point-cloud from lidar range image')
            lidar_pcl = tools.pcl_from_range_image(frame, lidar_name)
        else:
            print('loading lidar point-cloud from result file')
            lidar_pcl = load_object_from_file(results_fullpath, data_filename,
                                              'lidar_pcl', cnt_frame)

        ## Compute lidar birds-eye view (bev)
        if 'bev_from_pcl' in exec_list:
            print('computing birds-eye view from lidar pointcloud')
            lidar_bev = pcl.bev_from_pcl(lidar_pcl, configs_det)
        else:
            print('loading birds-eve view from result file')
            lidar_bev = load_object_from_file(results_fullpath, data_filename,
                                              'lidar_bev', cnt_frame)

        ## 3D object detection
        if (configs_det.use_labels_as_objects == True):
            print('using groundtruth labels as objects')
            detections = tools.convert_labels_into_objects(
                frame.laser_labels, configs_det)