-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add illustration.png, pcam, requirements.txt, setup.py
- Loading branch information
Showing
51 changed files
with
15,170 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DATASET: '3dmatch' | ||
NUM_POINTS: 4096 | ||
SPARSE_ATTENTION: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
DATASET: '3dmatch' | ||
NUM_POINTS: 4096 | ||
SPARSE_ATTENTION: False | ||
# This threshold was optimised on the validation of 3dmatch | ||
THRESHOLD: .6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DATASET: '3dmatch' | ||
NUM_POINTS: 4096 | ||
SPARSE_ATTENTION: False | ||
# This threshold was optimised on the validation of 3dmatch | ||
THRESHOLD: .6 | ||
DGR_OPTIM: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
DATASET: '3dmatch' | ||
NUM_POINTS: 4096 | ||
SPARSE_ATTENTION: False | ||
# This threshold was optimised on the validation of 3dmatch | ||
THRESHOLD: .6 | ||
DGR_OPTIM: True | ||
# Safeguard registration (as in DGR) when the confidence scores are below a threshold (WSUM_THRESHOLD) | ||
# This threshold was optimised to apply safeguard on the same number of scans as in DGR | ||
SAFEGUARD: True | ||
WSUM_THRESHOLD: 930 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DATASET: '3dmatch' | ||
NUM_POINTS: 4096 | ||
SPARSE_ATTENTION: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
DATASET: '3dmatch' | ||
NUM_POINTS: 4096 | ||
SPARSE_ATTENTION: True | ||
# This threshold was optimised on the validation of 3dmatch | ||
THRESHOLD: .5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DATASET: '3dmatch' | ||
NUM_POINTS: 4096 | ||
SPARSE_ATTENTION: True | ||
# This threshold was optimised on the validation of 3dmatch | ||
THRESHOLD: .5 | ||
DGR_OPTIM: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
DATASET: '3dmatch' | ||
NUM_POINTS: 4096 | ||
SPARSE_ATTENTION: True | ||
# This threshold was optimised on the validation of 3dmatch | ||
THRESHOLD: .5 | ||
DGR_OPTIM: True | ||
# Safeguard registration (as in DGR) when the confidence scores are below a threshold (WSUM_THRESHOLD) | ||
# This threshold was optimised to apply safeguard on the same number of scans as in DGR | ||
SAFEGUARD: True | ||
WSUM_THRESHOLD: 930 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DATASET: 'kitti' | ||
NUM_POINTS: 2048 | ||
SPARSE_ATTENTION: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
DATASET: 'kitti' | ||
NUM_POINTS: 2048 | ||
SPARSE_ATTENTION: False | ||
ICP: .6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DATASET: 'kitti' | ||
NUM_POINTS: 2048 | ||
SPARSE_ATTENTION: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
DATASET: 'kitti' | ||
NUM_POINTS: 2048 | ||
SPARSE_ATTENTION: True | ||
ICP: .6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DATASET: 'modelnet' | ||
NUM_POINTS: 2048 | ||
SPARSE_ATTENTION: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DATASET: 'modelnet_noise' | ||
NUM_POINTS: 2048 | ||
SPARSE_ATTENTION: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DATASET: 'modelnet_unseen' | ||
NUM_POINTS: 2048 | ||
SPARSE_ATTENTION: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DATASET: 'modelnet' | ||
NUM_POINTS: 2048 | ||
SPARSE_ATTENTION: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DATASET: 'modelnet_noise' | ||
NUM_POINTS: 2048 | ||
SPARSE_ATTENTION: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DATASET: 'modelnet_unseen' | ||
NUM_POINTS: 2048 | ||
SPARSE_ATTENTION: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Dataset: 3DMatch | ||
|
||
## Folder structure | ||
|
||
Place the 3DMatch dataset in this folder (`/path/to/pcam/data/3dmatch/`), which should contain the following subfolders: | ||
``` | ||
./threedmatch/ # Contains the training and validation set | ||
./threedmatch/*.npz | ||
./threedmatch/*.txt | ||
./threedmatch_test/ # Contains the test set | ||
./threedmatch_test/*.npz | ||
./threedmatch_test/*.txt | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Dataset: KITTI | ||
|
||
## Folder structure | ||
|
||
Place the KITTI dataset in this folder (`/path/to/pcam/data/kitti/`), which should contain the following subfolders: | ||
``` | ||
./dataset/ | ||
./dataset/poses/ | ||
./dataset/poses/*.txt | ||
./dataset/sequences/ | ||
./dataset/sequences/00/ | ||
./dataset/sequences/01/ | ||
etc. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Dataset: ModelNet | ||
|
||
## Folder structure | ||
|
||
Place the ModelNet dataset in this folder (`/path/to/pcam/data/modelnet/`), which should contain the following subfolders: | ||
``` | ||
./modelnet40_ply_hdf5_2048/ | ||
./modelnet40_ply_hdf5_2048/ply_data_test0.h5 | ||
./modelnet40_ply_hdf5_2048/ply_data_test1.h5 | ||
./modelnet40_ply_hdf5_2048/ply_data_test_0_id2file.json | ||
etc. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Part of the code in this file is taken from https://github.com/chrischoy/DeepGlobalRegistration/blob/46dd264580b4191accedc277f4ae434acdb4d380/dataloader/base_loader.py#L24 | ||
|
||
from pcam.tool.transforms import decompose_rotation_translation | ||
import lightconvpoint.nn as lcp_nn | ||
import torch | ||
import numpy as np | ||
|
||
class CollateFunc: | ||
def __init__(self): | ||
self.collation_fn = self.collate_pair_fn | ||
|
||
def __call__(self, list_data): | ||
return self.collation_fn(list_data) | ||
|
||
def collate_pair_fn(self, list_data): | ||
N = len(list_data) | ||
|
||
list_data = [data for data in list_data if data is not None] | ||
if N != len(list_data): | ||
logging.info(f"Retain {len(list_data)} from {N} data.") | ||
if len(list_data) == 0: | ||
raise ValueError('No data in the batch') | ||
|
||
xyz0_full, xyz1_full, xyz0, xyz1, trans, inv_trans, one_one_attention, filename, p0_mean, p1_mean = list( | ||
zip(*list_data) | ||
) | ||
|
||
trans_batch = torch.from_numpy(np.stack(trans)).float() | ||
inv_trans_batch = torch.from_numpy(np.stack(inv_trans)).float() | ||
|
||
pts1 = torch.from_numpy(np.stack(xyz0)).float() | ||
pts2 = torch.from_numpy(np.stack(xyz1)).float() | ||
raw_pts1 = torch.from_numpy(np.stack(xyz0_full)).float() | ||
raw_pts2 = torch.from_numpy(np.stack(xyz1_full)).float() | ||
|
||
p0_mean = torch.from_numpy(np.stack(p0_mean)).float().transpose(1, 2) | ||
p1_mean = torch.from_numpy(np.stack(p1_mean)).float().transpose(1, 2) | ||
|
||
Rs, ts = decompose_rotation_translation(trans_batch) | ||
Rs_inv, ts_inv = decompose_rotation_translation(inv_trans_batch) | ||
|
||
ts = ts.unsqueeze(-1) | ||
ts_inv = ts_inv.unsqueeze(-1) | ||
|
||
search = lcp_nn.SearchQuantized(K=32, stride=1) | ||
pts1 = pts1.transpose(1, 2) | ||
pts2 = pts2.transpose(1, 2) | ||
indices1, pts1 = search(pts1) | ||
indices2, pts2 = search(pts2) | ||
|
||
one_one_attention = torch.from_numpy(np.stack(one_one_attention)).float() | ||
|
||
return { | ||
"raw_src": raw_pts1, | ||
"raw_tgt": raw_pts2, | ||
"src": pts1, | ||
"tgt": pts2, | ||
"filename": filename, | ||
"attention": one_one_attention, | ||
"indices1": indices1, | ||
"indices2": indices2, | ||
"rotation": Rs, | ||
"translation": ts, | ||
"inv_rotation": Rs_inv, | ||
"inv_translation": ts_inv, | ||
"p0_mean": p0_mean, | ||
"p1_mean": p1_mean, | ||
} |
Oops, something went wrong.