Giter VIP home page Giter VIP logo

sghr's Introduction

😍 SGHR

Robust Multiview Point Cloud Registration with Reliable Pose Graph Initialization and History Reweighting

CVPR 2023

Haiping Wang*,1, Yuan Liu*,2, Zhen Dong†,1, Yulan Guo3, Yu-Shen Liu4, Wenping Wang5 Bisheng Yang†,1

1Wuhan University Β Β  2The University of Hong Kong Β Β  3Sun Yat-sen University Β Β 
4Tsinghua University Β Β  5Texas A&M University Β Β 
*The first two authors contribute equally. Β Β  †Corresponding authors. Β Β 

In this paper, we present a new method for the multiview registration of point cloud. Previous multiview registration methods rely on exhaustive pairwise registration to construct a densely-connected pose graph and apply Iteratively Reweighted Least Square (IRLS) on the pose graph to compute the scan poses. However, constructing a densely-connected graph is time-consuming and contains lots of outlier edges, which makes the subsequent IRLS struggle to find correct poses. To address the above problems, we first propose to use a neural network to estimate the overlap between scan pairs, which enables us to construct a sparse but reliable pose graph. Then, we design a novel history reweighting function in the IRLS scheme, which has strong robustness to outlier edges on the graph. In comparison with existing multiview registration methods, our method achieves $11$% higher registration recall on the 3DMatch dataset and $\sim13$% lower registration errors on the ScanNet dataset while reducing $\sim70$% required pairwise registrations. Comprehensive ablation studies are conducted to demonstrate the effectiveness of our designs.

| Paper | Poster | Video |

πŸ†• News

  • 2023-05-13: An introduction video of SGHR on YouTube.
  • 2023-04-04: Release SGHR on Arxiv.
  • 2023-04-01: The code of SGHR is released.
  • 2023-02-28: SGHR is accepted by CVPR 2023! πŸŽ‰πŸŽ‰

✨ Pipeline

Network

πŸ’» Requirements

Here we offer the YOHO backbone SGHR. Thus YOHO requirements need to be met:

  • Ubuntu 14.04 or higher
  • CUDA 11.1 or higher
  • Python v3.7 or higher
  • Pytorch v1.6 or higher

Specifically, The code has been tested with:

  • Ubuntu 16.04, CUDA 11.1, python 3.7.10, Pytorch 1.7.1, GeForce RTX 2080Ti.
  • Ubuntu 20.04, CUDA 11.1, python 3.7.16, Pytorch 1.10.0, GeForce RTX 4090.

πŸ”§ Installation

  • First, create the conda environment:

    conda create -n sghr python=3.7
    conda activate sghr
    
  • Second, intall Pytorch. We have checked version 1.7.1 and other versions can be referred to Official Set.

    conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=11.0 -c pytorch
    
  • Third, install other packages, here we use 0.8.0.0 version Open3d for Ubuntu 16.04:

    pip install -r requirements.txt
    
  • Finally, compile the CUDA based KNN searcher:

    cd knn_search/
    export CUDA_HOME=/usr/local/cuda-11.1 #We have checked cuda-11.1.
    python setup.py build_ext --inplace
    cd ..
    

πŸ’Ύ Dataset & Pretrained model

The datasets are accessible in BaiduDesk(Code:oouk) and Google Cloud:

Trainset:

Testset:

Datasets above contain the point clouds (.ply), keypoints (.txt, 5000 per point cloud), and rotation-invariant yoho-desc(.npy, extracted on the keypoints) files. Please place the data to ./data following the example data structure as:

data/
β”œβ”€β”€ 3dmatch/
    └── kitchen/
        β”œβ”€β”€ PointCloud/
            β”œβ”€β”€ cloud_bin_0.ply
            β”œβ”€β”€ gt.log
            └── gt.info
        β”œβ”€β”€ yoho_desc/
            └── 0.npy
        └── Keypoints/
            └── cloud_bin_0Keypoints.txt
β”œβ”€β”€ 3dmatch_train/
β”œβ”€β”€ scannet/
└── ETH/

πŸš… Train

You can train SGHR with the 3dmatch_train dataset downloaded above, where we offer the 32-dim rotation-invariant yoho-desc we extracted on 3dmatch_train and you can also extract 32-dim invariant yoho-desc(row-pooling on yoho-desc) yourself and save the features to '''data/3dmatch_train/<scene>/yoho_desc'''. Then, you can train SGHR with the following commond:

python Train.py

✏️ Test

To evalute SGHR on 3DMatch and 3DLoMatch, you can use the following commands:

# extract global features
python Test.py --dataset 3dmatch
# conduct multiview registration
python Test_cycle.py --dataset 3dmatch --rr

To evalute SGHR on ScanNet, you can use the following commands:

python Test.py --dataset scannet
python Test_cycle.py --dataset scannet --ecdf

To evalute SGHR on ETH, you can use the following commands:

python Test.py --dataset ETH
python Test_cycle.py --dataset ETH --topk 6 --inlierd 0.2 --tau_2 0.5 --rr

To evalute SGHR on your own dataset, you can follow here.

πŸ’‘ Citation

Please consider citing SGHR if this program benefits your project

@inproceedings{
wang2023robust,
title={Robust Multiview Point Cloud Registration with Reliable Pose Graph Initialization and History Reweighting},
author={Haiping Wang and Yuan Liu and Zhen Dong and Yulan Guo and Yu-Shen Liu and Wenping Wang and Bisheng Yang},
booktitle={Conference on Computer Vision and Pattern Recognition},
year={2023}
}

πŸ”— Related Projects

Take a look at our previous works on feature extraction and pairwise registration!

sghr's People

Contributors

hpwang-whu avatar liuyuan-pal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sghr's Issues

About using my own dataset for registration

Hello!
Your work is excellent, it happens to be the tool I need. I am a graduate student in civil engineering, using 3D scanning to reconstruct building scenes. However, during the scanning process, multiple locally overlapping scenes are usually used for registration. Currently, we still use manual methods for registration, and your work may greatly reduce this workload. I currently have about 10 different local point clouds in the same scene. Can I use your method for registration? How much time will this take approximately? Since I am not familiar with deep learning, could you provide a demo for us to learn?
Thanks!

3DLoMatch testset

In the testset, I cannot find the 3DLoMatch dataset. There is only a 3DMatch dataset. Could you upload the dataset to the network disk?

Computation of the translation synchronization

Thanks for the great work, I have a question for your implementation of translation synchronization.

In your implementation, the translation is computed using:

def leastsquare(locws, ts, pcrs, N):
'''
base : RiPi+ti = RjPj+tj
Pi = RijPj+tij
--> Ri(RijPj+tij)+ti = RjPj+tj
--> RiRij = Rj Ritij+ti = tj
--> -ti + tj = Ritij (3 formular)
least square:
B: (p*3)*(N*3)
P: (p*3)*(p*3)
L: Ritij--> (p*3)
'''
tpre = np.zeros([N,3])
p = locws.shape[0]
B = np.zeros([p*3, N*3])
P = np.eye(p*3)
L = np.zeros([p*3])
# get B and P
for pid in range(locws.shape[0]):
# the pid-th pair
i, j, w = int(locws[pid,0]), int(locws[pid,1]), locws[pid,2]
P[pid*3:(pid+1)*3] *= w
B[pid*3:(pid+1)*3, i*3:(i+1)*3] = -np.eye(3)
B[pid*3:(pid+1)*3, j*3:(j+1)*3] = np.eye(3)
# get L
for pid in range(locws.shape[0]):
# the pid-th pair
i, j, w = int(locws[pid,0]), int(locws[pid,1]), locws[pid,2]
L[pid*3:(pid+1)*3] = pcrs[i]@ts[pid] - (tpre[j]-tpre[i])
# delta
deltat = np.linalg.pinv(B.T@P@B)@(B.T@P@L)
tpre += deltat.reshape(N,3)
# final T
Tpre = []
for i in range(N):
r = pcrs[i]
t = tpre[i]
T = np.eye(4)
T[0:3,0:3] = r
T[0:3,-1] = t
Tpre.append(T[None,:,:])
Tpre = np.concatenate(Tpre, axis=0)
return Tpre

which corresponds to your paper:
image

But the original paper "Learning Transformation Synchronization" computes the translation following :
image

Because I failed to understand your implementation and the original implementation is more clearer, so following your code, I compute the translation using:

b = np.zeros([3*N])
for pid in range(len(locws)):
    i, j, w = int(locws[pid,0]), int(locws[pid,1]), locws[pid,2]
    xs, xe = i * 3, i * 3 + 3
    b[xs:xe] -= w * Rs[pid] @ (-Rs[pid].T@ts[pid])
tpre = np.linalg.pinv(L) @ b
tpre = tpre.reshape(N, 3)

However, the result tpre does not stay the same with your implementation.

So the two questions are:

Q1. What is the difference between these two implementations?

Q2. Why the results of these two implementations are not the same?

Thank you so much for your help.

What is the role of gt.info and test_3dmatch.pkl?Also bug report.

Amazing work, but there are some questions here.
1、What is the role of gt.info and test_3dmatch.pkl?I would like to use pre-trained models for testing, are these files mandatory? In the test flow, I get an error when I run the following command. The pkl file seems to be relevant to the dataset, but I don't know how to build it.
2.Report a bug, even if it's an easy bug to fix.
desc = np.load(f'{args.yoho_desc_dir}/{dataset.name}/YOHO_Output_Group_feature')
->
desc = np.load(f'{args.yoho_desc_dir}/{dataset.name}/YOHO_Output_Group_feature/{pid}.npy')

How should I train my dataset?

Hello, I would like to use your model to train on my own dataset. My dataset consists of point clouds from different viewpoints of a statue. However, I do not have the corresponding rotation and translation matrices between the point clouds pairwise. How can I address this issue? Thank you!

Some question about the paper and code

Hi @HpWang-whu ,
Thanks for sharing the code of your amazing work!
I have some questions during reading the paper and code.
Q1: The dataset includes 5000 keypoints per point cloud frame; I'm curious how these keypoints were chosen; were they randomly picked or were they chosen using a specific sampling method?
Q2: I noticed that 1200 to 5000 points and descriptions will be selected for data augmentation. Rather than the more common FPS or random uniform sample, the sample method used here is to sample neighbours from a random center point. I'm interested, is there a specific reason for using this strategy or just empirical choice.
Q3: Released code using l2 mode when calculating the overlap from point global features, rather than the inner mode indicated in Eq.3 from main paper. I'm curious whether there's a significant difference in performance between these two modes?

pre_attn = _f2overlap(f_attn, mode = 'l2')

SGHR/utils/utils.py

Lines 302 to 309 in 750f5ea

def _f2overlap(f, mode = 'l2'):
# f: n_scan*c
# normalization
f = f/torch.norm(f,dim=1,keepdim=True)
if mode == 'inner':
overlap = (f @ f.T + 1)/2.0
else:
overlap = (2 - torch.norm(f[:,None,:] - f[None,:,:], dim = -1))/2.0

Any assistance is much appreciated.

How to test on my own dataset?

Hello, thank your for your work!

I would like to test your model on my own dataset. I found this explanation in YOHO repository, but didn't understand some parts:
test_data

So, in my case, I acquired point clouds using 3D scanner. Therefore, I only have point clouds such as cloud_bin_0.ply, cloud_bin_1.ply, cloud_bin_2.ply, etc and I don't have "gt.log" and "gt.info" files. I want to merge them using your multiview registration method to have a better 3D recontruction.

  1. I checked the links for "gt.log" and "gt.info", and as I understood these files should be created during acquisition of point clouds. However, in my case, I am missing these files. Is there a way to obtain these files after aqusition or can I use model without it?
    log_info

  2. I am also missing the "cloud_bin_0Keypoints.txt", but as I understood it contains 5000 randomly sampled points from point cloud_bin0.ply. So I can create this file by myself.

I hope you understand my quesitons. Thank you!

Best regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.