GithubHelp home page GithubHelp logo

raoyongming / pointglr Goto Github PK

View Code? Open in Web Editor NEW
117.0 9.0 17.0 41 KB

[CVPR 2020] Global-Local Bidirectional Reasoning for Unsupervised Representation Learning of 3D Point Clouds

License: MIT License

CMake 0.79% Python 78.92% Shell 0.17% C 6.84% C++ 0.81% Cuda 12.47%
3d-point-clouds deep-learning unsupervised-learning computer-vision representation-learning metric-learning

pointglr's Introduction

PointGLR

This repository contains the PyTorch implementation for paper Global-Local Bidirectional Reasoning for Unsupervised Representation Learning of 3D Point Clouds (CVPR 2020) [arXiv]

overview

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

@inproceedings{rao2020global,
  title={Global-Local Bidirectional Reasoning for Unsupervised Representation Learning of 3D Point Clouds},
  author={Rao, Yongming and Lu, Jiwen and Zhou, Jie},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  year={2020}
}

Usage

Requirement

  • Python 3
  • Pytorch 0.4
  • CMake > 2.8

Note: The code is not not compatible with Pytorch >= 1.0 due to the C++/CUDA extensions.

Building C++/CUDA Extensions for PointNet++

mkdir build && cd build
cmake .. && make

Dataset Preparation

ModelNet

  • Download ModelNet point clouds (XYZ and normal):
mkdir dataset && cd dataset
wget https://shapenet.cs.stanford.edu/media/modelnet40_normal_resampled.zip
unzip modelnet40_normal_resampled.zip
  • Preprocess dataset:
CUDA_VISIBLE_DEVICES=0 python tools/prepare_modelnet.py

ScanNet

You can download our prepared ScanNet dataset for object classification from Google Drive and move the uncompressed data folder to dataset/scannet. The data structure should be:

dataset/scannet
├── train_files.txt
├── test_files.txt
├── train_0.h5
...
├── test_0.h5
...

ScanObjectNN

The ScanObjectNN dataset can be found here. You can download the h5_files.zipped and move the uncompressed data folder to dataset/ScanObjectNN. The data sturcture should be:

dataset/ScanObjectNN
├── main_split
|  └── training_objectdataset.h5
|  ...
├── main_split_nobg
|  └── training_objectdataset.h5
|  ...
...

Training & Evaluation

To train an SSG PointNet++ model on ModelNet:

bash train.sh exp_name pointnet2 modelnet

To train an SSG RSCNN model on ModelNet:

bash train.sh exp_name pointnet2 modelnet

You can modify multiplier in cfgs/config.yaml to train larger models. As a reference, the unsupervisedly trained 1x SSG PointNet++ and 1x SSG RSCNN models should have around 92.2% accuracy on ModelNet40. By increasing channel width (4x~5x), our best PointNet++ and RSCNN models achieved around 93.0% accuracy. The results might vary by 0.2%~0.5% between identical runs due to different random seed.

To obtain the results on ScanNet:

bash train.sh exp_name pointnet2 scannet

To obtain the results on ScanObjectNN:

bash train.sh exp_name pointnet2 scanobjectnn

Note that for experiments on ScanNet and ScanObjectNN, the feature extraction network is still trained on ModelNet. We only train the Linear SVM classifier on the corresponding dataset to obtain the classification results.

Acknowledgement

The code is based on Relation-Shape CNN and Pointnet2_PyTorch.

Contact

If you have any questions about our work, please contact [email protected]

pointglr's People

Contributors

raoyongming 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

pointglr's Issues

supervised vs. unsupervised

Very inspiring work. Thanks for making the code available.
Appreciate your efforts.
I have a question in reference to results presented in Table 3 for RSCNN.

RSCNN original 92.9
RSCNN original with voting 93.6

RSCNN supervised (Large) 92.0
Your w/ RSCNN (Large) unsupervised 92.9

Why is RSCNN supervised (Large) less than RSCNN Original?

Also, please let us know separate steps for training the supervised and unsupervised versions.

The meaning of a variable in code

I don't understand what the features1, fuse_global, global_feature1, REFs1 stand for in the code, especially fuse_global, global_feature1.Can you explain that to help me understand the paper better

bugs

File "utils/pointnet2_utils.py", line 11, in
from _ext import pointnet2
File "utils/_ext/pointnet2/init.py", line 3, in
from ._pointnet2 import lib as _lib, ffi as _ffi
ModuleNotFoundError: No module named '_ext.pointnet2._pointnet2'

when run ' CUDA_VISIBLE_DEVICES=0 python tools/prepare_modelnet.py '

my torch version is 0.4.1, python 3.6

How to train on RSCNN model?

Hi, @raoyongming
Thank you for sharing!

You just list the options on pointnet2 training :

bash train.sh exp_name pointnet2 modelnet

But you did not specify the --arch config of training on RSCNN? What is the name of RSCNN in your code?

Thank you very much!

/usr/include/cublas_api.h:77:27: fatal error: library_types.h: No such file or directory

Scanning dependencies of target pointnet2_ext
[ 20%] Building NVCC (Device) object CMakeFiles/cuda_compile.dir/utils/csrc/cuda_compile_generated_ball_query_gpu.cu.o
[ 40%] Building NVCC (Device) object CMakeFiles/cuda_compile.dir/utils/csrc/cuda_compile_generated_group_points_gpu.cu.o
[ 60%] Building NVCC (Device) object CMakeFiles/cuda_compile.dir/utils/csrc/cuda_compile_generated_interpolate_gpu.cu.o
[ 80%] Building NVCC (Device) object CMakeFiles/cuda_compile.dir/utils/csrc/cuda_compile_generated_sampling_gpu.cu.o
[100%] Generating ../utils/_ext/pointnet2/_pointnet2.so
In file included from /usr/include/cublas_v2.h:65:0,
from /home/hustget/miniconda2/envs/torch0.4/lib/python3.7/site-packages/torch/utils/ffi/../../lib/include/THC/THCGeneral.h:14,
from /home/hustget/miniconda2/envs/torch0.4/lib/python3.7/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:4,
from _pointnet2.c:570:
/usr/include/cublas_api.h:77:27: fatal error: library_types.h: No such file or directory
compilation terminated.
Traceback (most recent call last):
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/distutils/ccompiler.py", line 910, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/site-packages/cffi/ffiplatform.py", line 51, in _build
dist.run_command('build_ext')
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension
depends=ext.depends)
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/distutils/unixccompiler.py", line 120, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/media/hustget/A42C33A02C336D04/yangjinrong/PointGLR/utils/build_ffi.py", line 56, in
build(args)
File "/media/hustget/A42C33A02C336D04/yangjinrong/PointGLR/utils/build_ffi.py", line 44, in build
ffi.build()
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/site-packages/torch/utils/ffi/init.py", line 189, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/site-packages/torch/utils/ffi/init.py", line 111, in _build_extension
outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/site-packages/cffi/api.py", line 727, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/site-packages/cffi/recompiler.py", line 1565, in recompile
compiler_verbose, debug)
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/site-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/home/hustget/miniconda2/envs/torch0.4/lib/python3.7/site-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.class.name, e))
cffi.VerificationError: CompileError: command 'gcc' failed with exit status 1
CMakeFiles/pointnet2_ext.dir/build.make:67: recipe for target '../utils/_ext/pointnet2/_pointnet2.so' failed
make[2]: *** [../utils/_ext/pointnet2/_pointnet2.so] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/pointnet2_ext.dir/all' failed
make[1]: *** [CMakeFiles/pointnet2_ext.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

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.