Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NgeNet renamed with GCNet #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Paper "Neighborhood-aware Geometric Encoding Network for Point Cloud Registratio
```
# Compile

cd NgeNet/cpp_wrappers
cd GCNet/cpp_wrappers
sh compile_wrappers.sh
```

Expand Down Expand Up @@ -81,7 +81,7 @@ Unzip it, then we should get the following directories structure:
# exp_dir: your_saved_path for checkpoints and summary.
# root: your_data_path for the 3dMatch dataset.

cd NgeNet
cd GCNet
python train.py configs/threedmatch.yaml

# note: The code `torch.cuda.empty_cache()` in `train.py` has some impact on the training speed.
Expand All @@ -91,7 +91,7 @@ python train.py configs/threedmatch.yaml
### 1.3 evaluate and visualize

```
cd NgeNet
cd GCNet

python eval_3dmatch.py --benchmark 3DMatch --data_root your_path/indoor --checkpoint your_path/3dmatch.pth --saved_path work_dirs/3dmatch [--vis] [--no_cuda]

Expand Down Expand Up @@ -123,14 +123,14 @@ Download odometry kitti [here](http://www.cvlibs.net/datasets/kitti/eval_odometr
# exp_dir: your_saved_path for checkpoints and summary.
# root: your_data_path for the Odometry KITTI.

cd NgeNet
cd GCNet
python train.py configs/kitti.yaml
```

### 2.3 evaluate and visualize

```
cd NgeNet
cd GCNet
python eval_kitti.py --data_root your_path/kitti --checkpoint your_path/kitti.pth [--vis] [--no_cuda]
```

Expand Down
8 changes: 4 additions & 4 deletions demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
sys.path.append(os.path.dirname(os.path.abspath(__file__)))

from data import collate_fn
from models import architectures, NgeNet, vote
from models import architectures, GCNet, vote
from utils import decode_config, npy2pcd, pcd2npy, execute_global_registration, \
npy2feat, setup_seed, get_blue, get_yellow, voxel_ds, normal, \
read_cloud, vis_plys

CUR = os.path.dirname(os.path.abspath(__file__))


class NgeNet_pipeline():
class GCNet_pipeline():
def __init__(self, ckpt_path, voxel_size, vote_flag, cuda=True):
self.voxel_size_3dmatch = 0.025
self.voxel_size = voxel_size
Expand All @@ -25,7 +25,7 @@ def __init__(self, ckpt_path, voxel_size, vote_flag, cuda=True):
self.vote_flag = vote_flag
config = self.prepare_config()
self.neighborhood_limits = [38, 36, 35, 38]
model = NgeNet(config)
model = GCNet(config)
if self.cuda:
model = model.cuda()
model.load_state_dict(torch.load(ckpt_path))
Expand Down Expand Up @@ -178,7 +178,7 @@ def pipeline(self, source, target, npts=20000):
# loading model
cuda = not args.no_cuda
vote_flag = not args.no_vote
model = NgeNet_pipeline(
model = GCNet_pipeline(
ckpt_path=args.checkpoint,
voxel_size=args.voxel_size,
vote_flag=vote_flag,
Expand Down
4 changes: 2 additions & 2 deletions eval_3dmatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from tqdm import tqdm

from data import ThreeDMatch, get_dataloader
from models import architectures, NgeNet, vote
from models import architectures, GCNet, vote
from utils import decode_config, npy2pcd, pcd2npy, execute_global_registration, \
npy2feat, vis_plys, setup_seed, fmat, to_tensor, get_blue, \
get_yellow
Expand Down Expand Up @@ -93,7 +93,7 @@ def main(args):
shuffle=False,
neighborhood_limits=None)

model = NgeNet(config)
model = GCNet(config)
use_cuda = not args.no_cuda
if use_cuda:
model = model.cuda()
Expand Down
4 changes: 2 additions & 2 deletions eval_kitti.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from tqdm import tqdm

from data import Kitti, get_dataloader
from models import architectures, NgeNet, vote
from models import architectures, GCNet, vote
from utils import decode_config, npy2pcd, pcd2npy, execute_global_registration, \
npy2feat, vis_plys, setup_seed, fmat, to_tensor, get_blue, get_yellow
from metrics import Error_R, Error_t
Expand Down Expand Up @@ -39,7 +39,7 @@ def main(args):
neighborhood_limits=None)

print(neighborhood_limits)
model = NgeNet(config)
model = GCNet(config)
use_cuda = not args.no_cuda
if use_cuda:
model = model.cuda()
Expand Down
4 changes: 2 additions & 2 deletions eval_mvp_rg.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from tqdm import tqdm

from data import MVP_RG, get_dataloader
from models import architectures, NgeNet, vote
from models import architectures, GCNet, vote
from utils import decode_config, npy2pcd, pcd2npy, execute_global_registration, \
npy2feat, vis_plys, setup_seed, fmat, to_tensor, get_blue, get_yellow
from metrics import Error_R, Error_t, RMSE
Expand Down Expand Up @@ -38,7 +38,7 @@ def main(args):
neighborhood_limits=None)

print(neighborhood_limits)
model = NgeNet(config)
model = GCNet(config)
use_cuda = not args.no_cuda
if use_cuda:
model = model.cuda()
Expand Down
2 changes: 1 addition & 1 deletion misc/plot_fmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
plt.plot(x, dsn_, color='lightseagreen', linewidth=3, label='3DSN', linestyle=linestyle_tuple[4][-1])
plt.plot(x, ppffold_, color='royalblue', linewidth=3, label='PPF-FoldNet', linestyle=linestyle_tuple[5][-1])
plt.plot(x, cofinet_, color='tomato', linewidth=3, label='CoFiNet', linestyle='dashdot')
plt.plot(x, ngenet_, color='magenta', linewidth=3, label='NgeNet', linestyle='solid')
plt.plot(x, ngenet_, color='magenta', linewidth=3, label='GCNet', linestyle='solid')
plt.vlines(0.05, 0, 100, colors="gray", linestyles="dashed")
plt.xlim((0.01, 0.2))
plt.ylim((0, 100))
Expand Down
4 changes: 2 additions & 2 deletions models/NgeNet.py → models/GCNet.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from models import InformationInteractive


class NgeNet(nn.Module):
class GCNet(nn.Module):
def __init__(self, config):
super().__init__()
r = config.first_subsampling_dl * config.conv_radius
Expand Down Expand Up @@ -218,4 +218,4 @@ def forward(self, inputs):
batched_feats_l = batched_feats_l / torch.norm(batched_feats_l, dim=1, keepdim=True)
batched_feats = torch.cat([batched_feats, overlap_scores, saliency_scores], dim=-1)

return batched_feats, batched_feats_m, batched_feats_l
return batched_feats, batched_feats_m, batched_feats_l
2 changes: 1 addition & 1 deletion models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .architecures import architectures
from .information_interactive import InformationInteractive
from .vote import vote
from .NgeNet import NgeNet
from .GCNet import GCNet
4 changes: 2 additions & 2 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from torch.utils.tensorboard import SummaryWriter

from data import get_dataset, get_dataloader
from models import architectures, NgeNet
from models import architectures, GCNet
from losses import Loss
from utils import decode_config, setup_seed

Expand Down Expand Up @@ -50,7 +50,7 @@ def main():
neighborhood_limits=neighborhood_limits)

print(neighborhood_limits)
model = NgeNet(config).cuda()
model = GCNet(config).cuda()
model_loss = Loss(config)

if config.optimizer == 'SGD':
Expand Down