OpenPCDet Documentation

repository·master·Indexed 26 days ago

https://github.com/open-mmlab/openpcdet

A comprehensive, PyTorch-based open-source toolbox for LiDAR-based 3D object detection. It provides a unified framework for one-stage and two-stage detection models, supporting large-scale datasets including KITTI, Waymo, NuScenes, ONCE, and Argoverse2. Key features include distributed training, multi-scale detection, GPU-accelerated 3D IoU calculation, and rotated NMS.

Tokens
6.3K
Snippets
23
Records
48
Agent score
91%

What's inside OpenPCDet

  1. Overview of OpenPCDet

    master
    OpenPCDet is an open-source, PyTorch-based toolbox designed for LiDAR-based 3D object detection. It provides a unified framework for both one-stage and two-stage 3D detection methods. The project is designed for extensibility, featuring data-model separation and a unified 3D box definition (x, y, z, dx, dy, dz, heading).
  2. Key Features of OpenPCDet

    master

    OpenPCDet supports several advanced features for 3D object detection:

    • Frameworks: Both one-stage and two-stage 3D object detection frameworks.
    • Distributed Computing: Distributed training and testing across multiple GPUs and multiple machines.
    • Multi-scale Detection: Support for multiple heads on different scales to detect various classes.
    • Point Abstraction: Stacked version set abstraction to encode varying point densities.
    • Target Assignment: Adaptive Training Sample Selection (ATSS).
    • Pooling Operations: RoI-aware point cloud pooling and RoI-grid point cloud pooling.
    • Optimization: GPU-accelerated 3D IoU calculation and rotated NMS.
  3. OpenPCDet Design Patterns

    master

    The toolbox follows specific design patterns to facilitate development and extension:

    • Data-Model Separation: Uses a unified point cloud coordinate system to allow easy extension to custom datasets.
    • Unified 3D Box Definition: All models use the format (x, y, z, dx, dy, dz, heading).
    • Flexible Model Structure: A clear architecture that supports various 3D detection models within a single framework.
  4. Set point cloud range and voxel sizes for voxel/pillar detectors

    master

    When using voxel-based detectors (e.g., SECOND, PV-RCNN, CenterPoint) or pillar-based detectors (e.g., PointPillar), ensure your configuration adheres to these constraints:

    1. Z-axis: Point cloud range along z-axis / voxel_size must equal 40.
    2. X & Y axes: Point cloud range along x&y-axis / voxel_size must be a multiple of 16.
  5. Evaluate MPPNet models

    master

    You can evaluate MPPNet using a pretrained checkpoint. To avoid Out-of-Memory (OOM) errors, it is recommended to set batch_size to 1.

    Single GPU Evaluation:

    python test.py --cfg_file cfgs/waymo_models/mppnet_4frames.yaml --batch_size 1 --ckpt ../output/waymo_models/mppnet_4frames/default/ckpt/checkpoint_epoch_6.pth

    Multi-GPU Evaluation:

    bash scripts/dist_test.sh ${NUM_GPUS} --cfg_file cfgs/waymo_models/mppnet_4frames.yaml --batch_size 1 --ckpt ../output/waymo_models/mppnet_4frames/default/ckpt/checkpoint_epoch_6.pth
  6. Prepare label files for a custom dataset

    master

    Annotations for the custom dataset must be stored in .txt files. Each line in the text file represents one bounding box in a scene using the following format:

    [x y z dx dy dz heading_angle category_name]

    Ensure the boxes follow the unified 3D box definition used by OpenPCDet. Example lines:

    1.50 1.46 0.10 5.12 1.85 4.13 1.56 Vehicle
    5.54 0.57 0.41 1.08 0.74 1.95 1.57 Pedestrian
    1.50 1.46 0.10 5.12 1.85 4.13 1.56 Vehicle
  7. Test and Evaluate Pretrained Models

    master

    Use test.py to evaluate models. You can specify the configuration file, batch size, and checkpoint path.

    Options:

    • --eval_all: Test all saved checkpoints of a specific training setting and draw performance curves on Tensorboard.
    • Multi-GPU Testing: Use scripts/dist_test.sh or scripts/slurm_test_mgpu.sh.
  8. Install OpenPCDet v0.5

    master

    Follow these steps to install OpenPCDet. If you have a previous version installed, you must re-install by running python setup.py develop to ensure the v0.5 components are correctly linked.

    1. Clone the repository:
      git clone https://github.com/open-mmlab/OpenPCDet.git
    2. Install dependencies: Install the required Python libraries listed in requirements.txt using pip.
    3. Install spconv: Choose the version of spconv compatible with your PyTorch version (see requirements for details).
    4. Install OpenPCDet in development mode: Run the setup script to install the library and its dependencies.
    git clone https://github.com/open-mmlab/OpenPCDet.git
    # (Install requirements.txt and spconv first)
    python setup.py develop