GithubHelp home page GithubHelp logo

hkust-vgd / lcd Goto Github PK

View Code? Open in Web Editor NEW
130.0 11.0 19.0 143.2 MB

[AAAI'20] LCD: Learned Cross-Domain Descriptors for 2D-3D Matching

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
descriptors 2d-3d-correspondences 3d-deep-learning pytorch

lcd's Introduction

LCD: Learned Cross-domain Descriptors for 2D-3D Matching

This is the official PyTorch implementation of the following publication:

LCD: Learned Cross-domain Descriptors for 2D-3D Matching
Quang-Hieu Pham, Mikaela Angelina Uy, Binh-Son Hua, Duc Thanh Nguyen, Gemma Roig, Sai-Kit Yeung
AAAI Conference on Artificial Intelligence, 2020 (Oral)
Paper | Homepage | Video

2D-3D Match Dataset

Download http://hkust-vgd.ust.hk/2d3dmatch/

We collect a new dataset of 2D-3D correspondences by leveraging the availability of several 3D datasets from RGB-D scans. Specifically, we use the data from SceneNN and 3DMatch. Our training dataset consists of 110 RGB-D scans, of which 56 scenes are from SceneNN and 54 scenes are from 3DMatch. The 2D-3D correspondence data is generated as follows. Given a 3D point which is randomly sampled from a 3D point cloud, we extract a set of 3D patches from different scanning views. To find a 2D-3D correspondence, for each 3D patch, we re-project its 3D position into all RGB-D frames for which the point lies in the camera frustum, taking occlusion into account. We then extract the corresponding local 2D patches around the re-projected point. In total, we collected around 1.4 millions 2D-3D correspondences.

Usage

Prerequisites

Required PyTorch 1.2 or newer. Some other dependencies are:

Pre-trained models

We released three pre-trained LCD models with different descriptor size: LCD-D256, LCD-D128, and LCD-D64. All of the models can be found in the logs folder.

Training

After downloading our dataset, put all of the hdf5 files into the data folder.

To train a model on the 2D-3D Match dataset, use the following command:

$ python train.py --config config.json --logdir logs/LCD

Log files and network parameters will be saved to the logs/LCD folder.

Applications

Aligning two point clouds with LCD

This demo aligns two 3D colored point clouds using our pre-trained LCD descriptor with RANSAC. How to run:

$ python -m apps.align_point_cloud samples/000.ply samples/002.ply --logdir logs/LCD-D256/

For more information, use the --help option.

After aligning two input point clouds, the final registration result will be shown. For example:

Aligned point clouds

Note: This demo requires Open3D installed.

Prepare your own dataset

We provide two scripts that we found useful during our data processing. Please take a look and adopt it to your need.

  • scripts/sample_train.py: Sample 2D-3D correspondences from the 3DMatch dataset
  • scripts/convert_valtest.py: Convert the val-set.mat and test-set.mat files from 3DMatch into HDF5 format.

Citation

If you find our work useful for your research, please consider citing:

@inproceedings{pham2020lcd,
  title = {{LCD}: {L}earned cross-domain descriptors for 2{D}-3{D} matching},
  author = {Pham, Quang-Hieu and Uy, Mikaela Angelina and Hua, Binh-Son and Nguyen, Duc Thanh and Roig, Gemma and Yeung, Sai-Kit},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = 2020
}

If you use our dataset, please cite the following papers:

@inproceedings{hua2016scenenn,
  title = {{SceneNN}: {A} scene meshes dataset with a{NN}otations},
  author = {Hua, Binh-Son, and Pham, Quang-Hieu and Nguyen, Duc Thanh and Tran, Minh-Khoi and Yu, Lap-Fai and Yeung, Sai-Kit},
  booktitle = {International Conference on 3D Vision},
  year = 2016
}

@inproceedings{zeng20173dmatch,
  title = {{3DMatch}: {L}earning local geometric descriptors from {RGB}-{D} reconstructions},
  author= {Zeng, Andy and Song, Shuran and Nie{\ss}ner, Matthias and Fisher, Matthew and Xiao, Jianxiong and Funkhouser, Thomas},
  booktitle = {IEEE Conference on Computer Vision and Pattern Recognition},
  year = 2017
}

License

Our code is released under BSD 3-Clause license (see LICENSE for more details).

Our dataset is released under CC BY-NC-SA 4.0 license.

Contact: Quang-Hieu Pham ([email protected])

lcd's People

Contributors

pqhieu avatar sonhua 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  avatar

lcd's Issues

Problem about “if result.transformation.trace() == 4.0”

Hi!
When I match my point cloud data, I got the result "Cannot align two point clouds"

success = True
if result.transformation.trace() == 4.0:
    success = False

When I was debugging, I found that the problem was in the trace. What does this part mean?

Thanks!

Link to the dataset is broken.

Hi, Thanks a lot for your sharing. Could you check the link to the dataset? I want to take a look at the dataset but find the link is broken.

Code to prepare own dataset

I would like to apply your method to another dataset, however it's not very clear to me the exact steps needed to prepare the 2D-3D corresponding data. When do you plan to provide resources for this? Could you share the code/ a detailed guideline?

Experimental setup for training

Hi,

I wish to re-train your network (later on a different dataset of my own) and I am trying to assess the resources needed. In the paper it is mentioned that on a cluster it took 17 hours.

Could you please provide more details about your setup? Notably how many GPUs and what topology yielded this performance? Also, how to modify the training script to run on multiple GPUs - does nn.DataParallel suffice?

Thank you.

About test the registration of 2D image and 3D point cloud data

Hi!Thanks for your insteresting works.
If I want to test the registration of 2D image and 3D point cloud data, is there any requirement for the format of the 2D image?
If using .jpg format, can I directly run “python -m apps.align_point_cloud samples/.jpg samples/.ply --logdir logs/LCD-D256/”?

Hope to show a demo about producing a 2D-3D registration

Thanks.
Best wishes!

TypeError: registration_ransac_based_on_feature_matching(): incompatible function arguments. The following argument types are supported

Hi!
Thanks for your interesting work.When I run "python -m apps.align_point_cloud samples/000.ply samples/002.ply --logdir logs/LCD-D256/", I got the error: TypeError: registration_ransac_based_on_feature_matching(): incompatible function arguments. The following argument types are supported.

log:
python -m apps.align_point_cloud samples/000.ply samples/002.ply --logdir logs/LCD-D256/

Loading model from logs/LCD-D256/model.pth
Extracted 1469 features from source
Extracted 1432 features from target
Traceback (most recent call last):
File "/home/houyongkuo/miniconda3/envs/lmpr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/houyongkuo/miniconda3/envs/lmpr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/houyongkuo/Documents/lcd/apps/align_point_cloud.py", line 94, in
result = open3d.pipelines.registration.registration_ransac_based_on_feature_matching(
TypeError: registration_ransac_based_on_feature_matching(): incompatible function arguments. The following argument types are supported:
1. (source: open3d.cpu.pybind.geometry.PointCloud, target: open3d.cpu.pybind.geometry.PointCloud, source_feature: open3d::pipelines::registration::Feature, target_feature: open3d::pipelines::registration::Feature, mutual_filter: bool, max_correspondence_distance: float, estimation_method: open3d.cpu.pybind.pipelines.registration.TransformationEstimation = TransformationEstimationPointToPoint without scaling., ransac_n: int = 3, checkers: List[open3d.cpu.pybind.pipelines.registration.CorrespondenceChecker] = [], criteria: open3d.cpu.pybind.pipelines.registration.RANSACConvergenceCriteria = RANSACConvergenceCriteria class with max_iteration=100000, and confidence=9.990000e-01) -> open3d.cpu.pybind.pipelines.registration.RegistrationResult

Invoked with: PointCloud with 1469 points., PointCloud with 1432 points., Feature class with dimension = 256 and num = 1469
Access its data via data member., Feature class with dimension = 256 and num = 1432
Access its data via data member., 0.075, TransformationEstimationPointToPoint without scaling., 4, [CorrespondenceCheckerBasedOnDistance with distance_threshold=0.075000], RANSACConvergenceCriteria class with max_iteration=4000000, and confidence=5.000000e+02

Thanks!

train

Hello, I have some problems with training, I would like to ask, what is the version of pytorch for this original code?

The dataset is 503.

I want to download 2D-3D Match Dataset but it is 503 now.

Thanks!
Best wishes!

IndexError: index 268778 is out of bounds for axis 0 with size 0

Hi!
Thanks for your interesting work.
When I was aligning two point clouds with LCD using my demo data, I got the error:
IndexError: index 268778 is out of bounds for axis 0 with size 0.
I don't know how to use my data to finish registration.
Thanks!
Best wishes.

dataset

It seems that the dataset cannot be downloaded, can you check it? Thanks.
image

Train crashed

the training log is as followings:

| Batch [2545/3811] | loss: 0.3767 |
| Batch [2546/3811] | loss: 0.3716 |
| Batch [2547/3811] | loss: 0.3690 |

the training process is stuck here and the GPU memory is enough.
Has anyone else met this before?

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.