def test_calib(data_loader: ArgoverseTrackingLoader) -> None: assert data_loader.calib camera = "ring_front_center" calib = data_loader.get_calibration(camera) pc = data_loader.get_lidar(0) uv = calib.project_ego_to_image(pc) uv_cam = calib.project_ego_to_cam(pc) assert (uv == calib.project_cam_to_image(uv_cam)).all assert (uv_cam == calib.project_image_to_cam(uv)).all assert (pc == calib.project_image_to_ego(uv)).all
def make_grid_ring_camera(argoverse_data: ArgoverseTrackingLoader, idx: int) -> Tuple[plt.Figure, plt.Axes]: f, ax = plt.subplots(3, 3, figsize=(20, 15)) camera = "ring_front_left" img = argoverse_data.get_image_sync(idx, camera=camera) objects = argoverse_data.get_label_object(idx) calib = argoverse_data.get_calibration(camera) img_vis = Image.fromarray(show_image_with_boxes(img, objects, calib)) ax[0, 0].imshow(img_vis) ax[0, 0].set_title("Ring Front Left") ax[0, 0].axis("off") camera = "ring_front_center" img = argoverse_data.get_image_sync(idx, camera=camera) objects = argoverse_data.get_label_object(idx) calib = argoverse_data.get_calibration(camera) img_vis = Image.fromarray(show_image_with_boxes(img, objects, calib)) ax[0, 1].imshow(img_vis) ax[0, 1].set_title("Right Front Center") ax[0, 1].axis("off") camera = "ring_front_right" img = argoverse_data.get_image_sync(idx, camera=camera) objects = argoverse_data.get_label_object(idx) calib = argoverse_data.get_calibration(camera) img_vis = Image.fromarray(show_image_with_boxes(img, objects, calib)) ax[0, 2].imshow(img_vis) ax[0, 2].set_title("Ring Front Right") ax[0, 2].axis("off") camera = "ring_side_left" img = argoverse_data.get_image_sync(idx, camera=camera) objects = argoverse_data.get_label_object(idx) calib = argoverse_data.get_calibration(camera) img_vis = Image.fromarray(show_image_with_boxes(img, objects, calib)) ax[1, 0].imshow(img_vis) ax[1, 0].set_title("Ring Side Left") ax[1, 0].axis("off") ax[1, 1].axis("off") camera = "ring_side_right" img = argoverse_data.get_image_sync(idx, camera=camera) objects = argoverse_data.get_label_object(idx) calib = argoverse_data.get_calibration(camera) img_vis = Image.fromarray(show_image_with_boxes(img, objects, calib)) ax[1, 2].imshow(img_vis) ax[1, 2].set_title("Ring Side Right") ax[1, 2].axis("off") camera = "ring_rear_left" img = argoverse_data.get_image_sync(idx, camera=camera) objects = argoverse_data.get_label_object(idx) calib = argoverse_data.get_calibration(camera) img_vis = Image.fromarray(show_image_with_boxes(img, objects, calib)) ax[2, 0].imshow(img_vis) ax[2, 0].set_title("Ring Rear Left") ax[2, 0].axis("off") ax[2, 1].axis("off") camera = "ring_rear_right" img = argoverse_data.get_image_sync(idx, camera=camera) objects = argoverse_data.get_label_object(idx) calib = argoverse_data.get_calibration(camera) img_vis = Image.fromarray(show_image_with_boxes(img, objects, calib)) ax[2, 2].imshow(img_vis) ax[2, 2].set_title("Ring Rear Right") ax[2, 2].axis("off") return f, ax
def test_calibration(data_loader: ArgoverseTrackingLoader) -> None: for camera in CAMERA_LIST: calib = data_loader.get_calibration(camera, "1") assert calib.camera == camera