lingvo.tasks.car.tools.export_kitti_detection module

Read saved Decoder’s outputs and convert to KITTI text format.

First, obtain a KITTI camera calibration file.

To export all detections from a single model:

python export_kitti_detection.py –decoder_path=/path/to/decoder_out_000103000 –calib_file=/tmp/kitti_test_calibs.npz –output_dir=/tmp/my-kitti-export-directory –logtostderr

— OR —

Export combined detections selected from multiple models:

python export_kitti_detection.py –car_decoder_path=/path/to/car_decoder_out –ped_decoder_path=/path/to/ped_decoder_out –cyc_decoder_path=/path/to/cyc_decoder_out –calib_file=/tmp/kitti_test_calibs.npz –output_dir=/tmp/my-kitti-export-directory –logtostderr

lingvo.tasks.car.tools.export_kitti_detection.LoadCalibData(fname)[source]

Load and parse calibration data from NPZ file.

lingvo.tasks.car.tools.export_kitti_detection.ExtractNpContent(np_dict, calib)[source]

Parse saved np arrays and convert 3D bboxes to camera0 coordinates.

Parameters
  • np_dict – a dict of numpy arrays.

  • calib – a parsed calibration dictionary.

Returns

  • location_camera: [N, 3]. [x, y, z] in camera0 coordinate.

  • dimension_camera: [N, 3]. The [height, width, length] of objects.

  • phi_camera: [N]. Rotation around y-axis in camera0 coodinate.

  • bboxes_2d: [N, 4]. The corresponding 2D bboxes in the image coordinate.

  • scores: [N]. Confidence scores for each box for the assigned class.

  • class_ids: [N]. The class id assigned to each box.

Return type

A tuple of 6 ndarrays

lingvo.tasks.car.tools.export_kitti_detection.ExportKITTIDetection(out_dir, source_id, location_cam, dimension_cam, rotation_cam, bboxes_2d, scores, class_name, is_first)[source]

Write detections to a text file in KITTI format.

lingvo.tasks.car.tools.export_kitti_detection.main(argv)[source]