Giter Site home page Giter Site logo

tiangexiang / curvenet Goto Github PK

View Code? Open in Web Editor NEW
166.0 3.0 27.0 1.29 MB

[ICCV 2021] Walk in the Cloud: Learning Curves for Point Clouds Shape Analysis

Home Page: https://curvenet.github.io/

License: MIT License

Python 99.49% Shell 0.51%
point-cloud iccv2021 iccv point-cloud-processing 3d-vision

curvenet's Introduction

CurveNet

Official implementation of "Walk in the Cloud: Learning Curves for Point Clouds Shape Analysis", ICCV 2021

PWC
PWC

Paper: https://arxiv.org/abs/2105.01288

CurveNet

Requirements

  • Python>=3.7
  • PyTorch>=1.2
  • Packages: glob, h5py, sklearn

Contents

NOTE: Please change your current directory to core/ first before excuting the following commands.

Point Cloud Classification

Data

The ModelNet40 dataset is primarily used for the classification experiments. At your first run, the program will automatically download the data if it is not in data/. Or, you can manually download the offical data and unzip to data/.

Alternatively, you can place your downloaded data anywhere you like, and link the path to DATA_DIR in core/data.py. Otherwise, the download will still be automatically triggered.

Train

Train with our default settings (same as in the paper):

python3 main_cls.py --exp_name=curvenet_cls_1

Train with customized settings with the flags: --lr, --scheduler, --batch_size.

Alternatively, you can directly modify core/start_cls.sh and simply run:

./start_cls.sh

NOTE: Our reported model achieves 93.8%/94.2% accuracy (see sections below). However, due to randomness, the best result might require repeated training processes. Hence, we also provide another benchmark result here (where we repeated 5 runs with different random seeds, and report their average), which is 93.65% accuracy.

Evaluation

Evaluate without voting:

python3 main_cls.py --exp_name=curvenet_cls_1 --eval=True --model_path=PATH_TO_YOUR_MODEL

Alternatively, you can directly modify core/test_cls.sh and simply run:

./test_cls.sh

For voting, we used the voting_evaluate_cls.pyscript provided in RSCNN. Please refer to their license for usage.

Evaluation with our pretrained model:

Please download our pretrained model cls/ at google drive.

And then run:

python3 main_cls.py --exp_name=curvenet_cls_pretrained --eval --model_path=PATH_TO_PRETRAINED/cls/models/model.t7

 

Point Cloud Part Segmentation

Data

The ShapeNet Part dataset is primarily used for the part segmentation experiments. At your first run, the program will automatically download the data if it is not in data/. Or, you can manually download the offical data and unzip to data/.

Alternatively, you can place your downloaded data anywhere you like, and link the path to DATA_DIR in core/data.py. Otherwise, the download will still be automatically triggered.

Train

Train with our default settings (same as in the paper):

python3 main_partseg.py --exp_name=curvenet_seg_1

Train with customized settings with the flags: --lr, --scheduler, --batch_size.

Alternatively, you can directly modify core/start_part.sh and simply run:

./start_part.sh

NOTE: Our reported model achieves 86.6%/86.8% mIoU (see sections below). However, due to randomness, the best result might require repeated training processes. Hence, we also provide another benchmark result here (where we repeated 5 runs with different random seeds, and report their average), which is 86.46 mIoU.

Evaluation

Evaluate without voting:

python3 main_partseg.py --exp_name=curvenet_seg_1 --eval=True --model_path=PATH_TO_YOUR_MODEL

Alternatively, you can directly modify core/test_part.sh and simply run:

./test_part.sh

For voting, we used the voting_evaluate_partseg.pyscript provided in RSCNN. Please refer to their license for usage.

Evaluation with our pretrained model:

Please download our pretrained model partseg/ at google drive.

And then run:

python3 main_partseg.py --exp_name=curvenet_seg_pretrained --eval=True --model_path=PATH_TO_PRETRAINED/partseg/models/model.t7

 

Point Cloud Normal Estimation

Data

The ModelNet40 dataset is used for the normal estimation experiments. We have preprocessed the raw ModelNet40 dataset into .h5 files. Each point cloud instance contains 2048 randomly sampled points and point-to-point normal ground truths.

Please download our processed data here and place it to data/, or you need to specify the data root path in core/data.py.

Train

Train with our default settings (same as in the paper):

python3 main_normal.py --exp_name=curvenet_normal_1

Train with customized settings with the flags: --multiplier, --lr, --scheduler, --batch_size.

Alternatively, you can directly modify core/start_normal.sh and simply run:

./start_normal.sh

Evaluation

Evaluate without voting:

python3 main_normal.py --exp_name=curvenet_normal_1 --eval=True --model_path=PATH_TO_YOUR_MODEL

Alternatively, you can directly modify core/test_normal.sh and simply run:

./test_normal.sh

Evaluation with our pretrained model:

Please download our pretrained model normal/ at google drive.

And then run:

python3 main_normal.py --exp_name=curvenet_normal_pretrained --eval=True --model_path=PATH_TO_PRETRAINED/normal/models/model.t7

 

Point Cloud Classification Under Corruptions

In a recent work, Sun et al. studied robustness of state-of-the-art point cloud processing architectures under common corruptions. CurveNet was verifed by them to be the best architecture to function on common corruptions. Please refer to their official repo for details.

Citation

If you find this repo useful in your work or research, please cite:

@InProceedings{Xiang_2021_ICCV,
    author    = {Xiang, Tiange and Zhang, Chaoyi and Song, Yang and Yu, Jianhui and Cai, Weidong},
    title     = {Walk in the Cloud: Learning Curves for Point Clouds Shape Analysis},
    booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
    month     = {October},
    year      = {2021},
    pages     = {915-924}
}

Acknowledgement

Our code borrows a lot from:

curvenet's People

Contributors

tiangexiang avatar yuchenlichuck 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

curvenet's Issues

Part Segmentation Error

HY !
I am facing the following issue while running the part segmentation model.
Can you please help?
Thanks for your time.
image

[ISSUE]ON PART SEGEMENTATION IN SHAPENET PAER

HI, XIANG,
I found the code in part segmentation is wrong. Could you check with the code please?

mv: cannot stat 'shapenet_part_seg_hdf5_data': No such file or directory
Traceback (most recent call last):
  File "main_partseg.py", line 346, in <module>
    train(args, io)
  File "main_partseg.py", line 85, in train
    train_dataset = ShapeNetPart(partition='trainval', num_points=args.num_points, class_choice=args.class_choice)
  File "/home/liy0r/3d-few-shot/download/CurveNet/core/data.py", line 158, in __init__
    self.data, self.label, self.seg = load_data_partseg(partition)
  File "/home/liy0r/3d-few-shot/download/CurveNet/core/data.py", line 91, in load_data_partseg
    all_data = np.concatenate(all_data, axis=0)
  File "<__array_function__ internals>", line 6, in concatenate
ValueError: need at least one array to concatenate

About Voting Strategy

Hello, i'm interested in your paper, curvenet.

Where can I access to the voting strategy that you used in your M40 experiments?

Thank you.

Questions about gumbel-softmax without gumbel sampling

Thanks for your excellent work!
While reading through your paper I find that you've mentioned Gumbel samplings are disabled for avoiding any randomness, and from my view, Gubel-softmax without Gumbel sampling is simply equivalent to the softmax function with annealing coefficient. I'm wondering if my understanding is correct, thanks.

Missing related work for guided walk and crossover suppression

Hello, authors! Thanks for your excellent work. While reading the paper, I found no work cited for crossover suppression (in contrast, for dynamic momentum, you mention the Batch Normalization paper). The guided walk, which starts from "After the construction of the starting point set" on page 3 of the manuscript, also includes no citation. I wonder if you come out with the ideas for crossover suppression entirely on your own or if other works inspire you, but you forget to cite them in the paper.

Environment

What's the specific environment of Point-NN? Which cuda version and pytorch version? Thanks a lot.

vote strategy?

你好,请问,这个投票测试是什么意思,为什么会比最好的模型的还要高?

Semantic segmentation results?

Hi! Thanks for opening source this great work. I am wondering if you have applied CurveNet for the semantic segmentation task? E.g. S3DIS or ScanNet. Are you also expecting good performance there (since CurveNet performs pretty well on Part-seg task)? Or if there are any concerns you want to point out (high GPU memory etc.) Thanks in advance!

Edit: the reason I'm interested in this point is that, while the curve (walk of points) is very beneficial in feature learning on point clouds of objects, I'm curious if that also applies to complex scene point clouds. As there are often multiple objects in a scene, will the curves go through points on different objects (like linking the objects together)? Or will the curve just reside in one object. It's interesting to see the model's behavior when it scales to large and more complex point clouds.

about random_seed in voting strategy

hi, i write a voting_eval python program. It loads the trained model and test for M times, however, the result of everytime time is the same. I change the random seed but failed. Would you please open your voting_eval codes? Thanks!

about voting_evalute_cls.py

Thank you for sharing. I tried to reproduce the voting_evalute_cls.py of RS-CNN, but I did not get a satisfactory result about your pre-train models. So if it is convenient for you, I hope you can provide the code you use. Thinks again.

could not reproduce classification results

Hello !
Your work is very interesting.Thanks for sharing.
I trained and tested the classification network as per the instructions given by you on github page but results are far from what you have posted in the paper.
I would really ppriciate if you can comment on it.
image

About license

Thanks for sharing great work!!
Could you clarify license for both code and pretrained weights?

Thanks in advance,

classification normal?

nohup: ignoring input
Namespace(batch_size=32, epochs=200, eval=False, exp_name='exp', lr=0.0005, model_path='', momentum=0.9, multiplier=2.0, no_cuda=False, num_points=1024, scheduler='cos', test_batch_size=16, use_sgd=True)
random seed is: 8053
Using GPU : 0 from 1 devices
Traceback (most recent call last):
File "main_normal.py", line 208, in
train(args, io)
File "main_normal.py", line 54, in train
model = CurveNet(args.multiplier).to(device)
File "/opt/data/private/swz/CurveNet-main/core/models/curvenet_normal.py", line 58, in init
self.conv1 = nn.Conv1d(channels[0], num_classes, 1)
File "/root/anaconda3/envs/pytorch_hr3/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 250, in init
super(Conv1d, self).init(
File "/root/anaconda3/envs/pytorch_hr3/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 106, in init
self.weight = Parameter(torch.Tensor(
TypeError: new() received an invalid combination of arguments - got (float, int, int), but expected one of:

  • (*, torch.device device)
  • (torch.Storage storage)
  • (Tensor other)
  • (tuple of ints size, *, torch.device device)
    didn't match because some of the arguments have invalid types: (!float!, !int!, !int!)
  • (object data, *, torch.device device)
    didn't match because some of the arguments have invalid types: (!float!, !int!, !int!)

About classification modelnet40_normal?

Traceback (most recent call last):
File "main_normal.py", line 208, in
train(args, io)
File "main_normal.py", line 46, in train
train_loader = DataLoader(ModelNetNormal(args.num_points, partition='train'),
File "/opt/data/private/swz/CurveNet-main/core/data.py", line 140, in init
self.data, self.label = load_data_normal(partition)
File "/opt/data/private/swz/CurveNet-main/core/data.py", line 51, in load_data_normal
f = h5py.File(os.path.join(DATA_DIR, 'modelnet40_normal', 'normal_%s.h5'%partition), 'r+')
File "/root/anaconda3/envs/pytorch_swz/lib/python3.8/site-packages/h5py/_hl/files.py", line 442, in init
fid = make_fid(name, mode, userblock_size,
File "/root/anaconda3/envs/pytorch_swz/lib/python3.8/site-packages/h5py/_hl/files.py", line 197, in make_fid
fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5f.pyx", line 96, in h5py.h5f.open
FileNotFoundError: [Errno 2] Unable to open file (unable to open file: name = '../data/modelnet40_normal/normal_train.h5', errno = 2, error message = 'No such file or directory', flags = 1, o_flags = 2)

How to set radius and num_points for custom dataset?

Many thanks for your amazing project!

As the title says, I am working on a custom dataset, currently training on 1 GPU only. As such, every iteration is very slow, and was hoping you could help guide me about the intuition of setting the parameters of the model?
Do num_points need to be the same as the amount of points in your point cloud?
Is radius dependent on your dataset?

I am trying to predict angles and translations of planes intersecting my pointclouds, so it's essentially a regression task of a rotation and a translation matrix, with my pointcloud being centered and unit scaled.
Hope you can help me :)

What is the use of raw coordinates in the walk module?

Thanks for your contribution!I see the raw coordinate input in the walk module, but you don't use it in the subsequent processing, and there is no description of it in the paper. Is there something the code missed?

visualization

Hello, how do I visualize the results of part segmentation?

Questions about the codes and pre-trained models

Hi Tiange,

Congrats on your paper been accepted by ICCV2021, and thanks a lot for your great work!

I have read CurveNet, and tried to implement it. However, due to limited computational resources and my lack of experience, could you please share your codes and the pre-trained models as you indicated previously (say, 93.8/94.2 for ModelNet40 and 86.6/86.8 for ShapeNet)? The log files are also welcome. This will help our research a lot.

Thanks,
Xu

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.