Git Product home page Git Product logo

diffconvnet's Introduction

diffConv: Analyzing Irregular Point Clouds with an Irregular View

Standard spatial convolutions assume input data with a regular neighborhood structure. Existing methods typically generalize convolution to the irregular point cloud domain by fixing a regular "view" through e.g. a fixed neighborhood size, where the convolution kernel size remains the same for each point. However, since point clouds are not as structured as images, the fixed neighbor number gives an unfortunate inductive bias. We present a novel graph convolution named Difference Graph Convolution (diffConv), which does not rely on a regular view. diffConv operates on spatially-varying and density-dilated neighborhoods, which are further adapted by a learned masked attention mechanism. Experiments show that our model is very robust to the noise, obtaining state-of-the-art performance in 3D shape classification and scene understanding tasks, along with a faster inference speed.

[Arxiv] [ECCV]

Alt text

Dependencies

  • Python (tested on 3.7.11)
  • PyTorch (tested on 1.9.0)
  • CUDA (tested on 11.6)
  • other packages: sklearn, h5py, open3d
  • Install CUDA accelerated PointNet++ library under models/pointnet2.

3D Object Shape Classification

ModelNet40

Prepare dataset

python3 data_prep.py --dataset=modelnet40

Train the model with default hyperparameters

python3 main_cls.py --exp_name=md40_cls --dataset=modelnet40

There are many hyperparameters to customize, call

python3 main_cls.py --help

for details.

Evaluate with our pretrained model

python3 main_cls.py --exp_name=md40_cls_eval --dataset=modelnet40 --eval=True --model_path=checkpoints/model_cls.pth

--model_path can be any trained parameters.

Evaluate model performance under noise

. eval_modelnet40noise.sh

Train model on resplited ModelNet40

python3 main_cls.py --exp_name=md40_resplit --dataset=modelnet40resplit

Note that everytime the dataset is randomly resplitted.

ModelNet40-C

Prepare dataset

Follow the official instruction, then move ModelNet40-C/data/modelnet40_c to data/modelnet40_c folder.

Evaluate with our pretrained model

. eval_modelnet40C.sh

ScanObjectNN

Prepare dataset

Download the dataset and unzip it at data/h5_files.

Train the model with default hyperparameters

python3 main_cls.py --exp_name=sonn_cls --dataset=scanobjectnn --bg=False

set --bg to True to train the model on the pointcloud with backgrounds.

Evaluation

Same as ModelNet40.

3D Scene Segmentation

NB: Please be aware that there could be an error on the Toronto3D segmentation, as reported in issues, causing the model to show constant (and anormal) IoU during training. I failed to reproduce the error when I ran the code from scratch, and thus not able to debug it. I am really sorry for this. My best guess is that this bug could be fixed by importing the anaconda environment from environment.yaml.

Toronto3D

Prepare dataset (may require torch 1.8.x)

Download the dataset and unzip it to data/Toronto_3D, then run

python3 data_prep.py --dataset=toronto3d

Train the model with default hyperparameters

python3 main_seg.py --exp_name=trt_seg

Evaluate with our pretrained model

python3 main_seg.py --exp_name=trt_seg --eval=True --model_path=checkpoints/model_seg.pth

3D Object Shape Segmentation

ShapeNetPart

Prepare dataset

python3 data_prep.py --dataset=shapenetpart

Train the model with default hyperparameters

python3 main_partseg.py --exp_name=spnetpt_seg

Evaluation

Same as other tasks.

Citation

Please cite this paper if you find this work helpful to your research,

@inproceedings{lin2021diffconv,
    title={diffconv: Analyzing Irregular Point Clouds with an Irregular View},
    author={Lin, Manxi and Feragen, Aasa},
    booktitle={Proceedings of the European Conference on Computer Vision (ECCV)},
    year={2022}
}

License

MIT License

Acknowledgements

Part of this codebase is borrowed from PointNet, DGCNN, dgcnn.pytorch, CurveNet, Pointnet2.ScanNet. Sincere appreciation to their works!

diffconvnet's People

Contributors

mmmmimic 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

Watchers

 avatar

diffconvnet's Issues

about the 3D Scene Segmentation

Hi, thanks for sharing the code. I try to retrain the 3d scene segmentation task on my computer. I get some bugs when I start to train the model. show as below:
`Train 0, loss: 1.834570, train acc: 0.527190, train avg acc: 0.112260, train iou: 0.075878, mean iou: 0.479272

Test 0, loss: 1.757209, test acc: 0.546379, test avg acc: 0.111111, test iou: 0.068297, mean iou: 0.692278

Train 1, loss: 1.718582, train acc: 0.581674, train avg acc: 0.111090, train iou: 0.072744, mean iou: 0.69713

Test 1, loss: 1.735542, test acc: 0.546379, test avg acc: 0.111111, test iou: 0.068297, mean iou: 0.692278`
As you can see, the Test mean iou is not changed, it keeps the value stable (0.692278). Can you give me some suggestions?

TypeError: sequence item 0: expected str instance, int found

(diffconv)root@ailab-PowerEdge-T640:/home/ailab/diffconvNet#pvthon3 data_prep.py --dataset=toronto3d
Traceback (most recent call last):
File "data_prep.py", line 104, in
eval("download %s(data_dir)"%dataset)
File "", line 1, in
File "data_prep.py", ine 78, in download_toronto3d
split Toronto3D(i, data dir=data dir)
File "data_prep.py", line 7, in split_Toronto3D
import open3d .ml.torch as ml3d
File "/root/anaconda3/envs/diffconv/lib/python3.7/site-packages/open3d/ml/torch/ init.py", line 38, in
match_torch_ver = '.'.join( o3d torch version.release[:2] + ('*',))
TypeError: sequence item 0: expected str instance, int found

how to solve the question?

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.