PointDSC

repository·master·Indexed 42 days ago

https://github.com/xuyangbai/pointdsc

A PyTorch implementation of a deep neural network for robust 3D point cloud registration. PointDSC explicitly incorporates spatial consistency to prune outlier correspondences. It supports registration using FPFH, FCGF, and D3Feat descriptors and provides training and evaluation scripts for the 3DMatch, KITTI, and 3DLoMatch benchmarks.

Tokens
1.5K
Snippets
9
Records
11
Agent score
5%

What's inside PointDSC

  1. Train and test on KITTI

    master

    Training

    Run the training script:

    python train_KITTI.py

    Testing

    Run the evaluation script. Replace [exp_id] with your snapshot folder name:

    python evaluation/test_KITTI.py --chosen_snapshot [exp_id] --use_icp False

    To test traditional outlier rejection baselines, use baseline_scripts/baseline_KITTI.py.

    python train_KITTI.py
    
    python evaluation/test_KITTI.py --chosen_snapshot [exp_id] --use_icp False
  2. Prepare the Augmented_ICL dataset for Multiway Registration

    master

    To run multiway registration experiments, you must first download the Augmented_ICL dataset from the official website. The files must be organized into a specific directory structure where each scene (e.g., livingroom1-simulated) contains color and depth subdirectories containing .png files, accompanied by a trajectory file (e.g., livingroom1-traj.txt) in the parent directory.

    ├── livingroom1-simulated
    │   ├── color
    │   │   └── *.png
    │   └── depth
    │       └── *.png
    ├── livingroom1-traj.txt
    ├── livingroom2-simulated
    │   ├── color
    │   └── depth
    ├── livingroom2-traj.txt
    ├── office1-simulated
    │   ├── color
    │   └── depth
    ├── office1-traj.txt
    ├── office2-simulated
    │   ├── color
    │   └── depth
    └── office2-traj.txt
  3. Train and test on 3DMatch

    master

    Training

    Run the training script:

    python train_3dmatch.py

    Training configurations can be modified in config.py.

    Testing

    Run the evaluation script. Replace [exp_id] with your snapshot folder name (e.g., PointDSC_3DMatch_release):

    python evaluation/test_3DMatch.py --chosen_snapshot [exp_id] --use_icp False

    Results are saved in logs/. To test traditional outlier rejection baselines, use baseline_scripts/baseline_3DMatch.py.

    python train_3dmatch.py
    
    python evaluation/test_3DMatch.py --chosen_snapshot [exp_id] --use_icp False
  4. Preprocess the 3DMatch dataset

    master

    To use the 3DMatch dataset, ensure your data folder follows this structure:

    .                          
    ├── fragments                 
    │   ├── 7-scene-redkitechen/       
    │   ├── sun3d-home_at-home_at_scan1_2013_jan_1/      
    │   └── ...                
    ├── gt_result                   
    │   ├── 7-scene-redkitechen-evaluation/   
    │   ├── sun3d-home_at-home_at_scan1_2013_jan_1-evaluation/ 
    │   └── ...                   
    ├── threedmatch            
    │   ├── *.npz
    │   └── *.txt                            

    To reduce training time, pre-compute 3D local descriptors (FCGF or FPFH) using the provided scripts so that input correspondences can be built via NN search during training:

    • For FCGF: misc/cal_fcgf.py
    • For FPFH: misc/cal_fpfh.py
  5. Run Multiway Registration testing

    master

    Execute the multiway registration test using the test_multi_ate.py script. You must specify a --chosen_snapshot to indicate which model snapshot to use. Upon completion, the script saves and visualizes the combined point cloud.

    python multiway/test_multi_ate.py --chosen_snapshot [snapshot]
  6. Compute FPFH or FCGF descriptors

    master

    Local descriptors are computed for the generated .ply files to create putative correspondences for the network.

    • To compute FPFH descriptors, run python misc/cal_fpfh.py.
    • To compute FCGF descriptors, run python misc/cal_fcgf.py.

    Note: If using FCGF, you must first download the pre-trained weights from this link.

    python misc/cal_fpfh.py
    # python misc/cal_fcgf.py
  7. Create point cloud fragments from RGB-D sequences

    master

    Use the make_fragments.py script to convert RGB-D sequences into point cloud fragments. You must provide a JSON configuration file for the specific scene. The resulting .ply files will be stored in a fragments/ directory within the scene's path.

    python multiway/make_fragments.py redwood_simulated/livingroom1-simulated.json
  8. Evaluate on 3DLoMatch benchmark

    master

    To evaluate PointDSC on the 3DLoMatch benchmark, use the following command. If using the predator descriptor, you must first follow the official OverlapPredator instructions to extract features.

    python evaluation/test_3DLoMatch.py --chosen_snapshot [exp_id] --descriptor [fcgf/predator] --num_points 5000
  9. Run the PointDSC registration demo

    master

    You can run a demo to extract dense FPFH descriptors for two point clouds and register them using PointDSC. The demo uses files in the demo_data folder.

    Note on Models:

    • Use the model pretrained on 3DMatch for indoor RGB-D scans.
    • Use the model pretrained on KITTI for outdoor LiDAR scans.

    Note on Descriptors:

    • For challenging cases, it is recommended to use learned feature descriptors like FCGF or D3Feat instead of FPFH.
    python demo_registration.py --chosen_snapshot [PointDSC_3DMatch_release/PointDSC_KITTI_release] --descriptor [fcgf/fpfh]