GithubHelp home page GithubHelp logo

openpcseg's Introduction

OpenPCSeg: An Open Source Point Cloud Segmentation Codebase

License open issues GitHub forks

OpenPCSeg is an open-source point cloud segmentation toolbox based on PyTorch, heading towards the unification and thriving of 3D scene understanding and its related areas. With the help of OpenPCSeg, we benchmark methods in a way that pursues fairness, efficiency, and effectiveness, on prevailing large-scale point cloud datasets. At this moment, OpenPCSeg focuses on outdoor point cloud segmentation for autonomous driving.

This project is developed and maintained by Autonomous Driving Group [at] Shanghai AI Laboratory (ADLab).

Highlight

  • 🌈 Comprehensive: We support the full spectrum of point cloud scene understanding tasks on standard large-scale benchmarks, with backbones across various 2D & 3D modalities.
  • ⚖️ Fair & Reproducible: We unify the training, validation, and testing configurations, resulting in directly comparable 3D segmentation performance.
  • 🚀 Fast & Accurate: Our implementations yield much better segmentation accuracy as well as training and inference speed than the originally reported results.

Supported Task

# Task Emphasis Dataset Method
🚗 Fully-Supervised LiDAR Segmentation Accuracy 2 4

Changelog

  • [2023.4] - Support sequence-wise OpenPCSeg inference and visualization on Waymo Open Dataset.
  • [2023.3] - Initial release of OpenPCSeg v1.0.

Upcoming Features

  • Support NuScenes Dataset
  • Add implementations of range-view algorithms
  • Add toolbox for competition submission
  • Add visualiztion of 3D segmentation results

Outline

Supported Methods

Supported Benchmark

LiDAR Semantic Segmentation (5)

LiDAR Panoptic Segmentation (3)

Model Zoo

SemanticKITTI Dataset Representative Models

Selected supported methods are shown in the below table. The results are mean IoU performance of moderate difficulty on the val set of SemanticKITTI dataset.

  • All LiDAR-based models are trained with 2 A100 GPUs and are available for download.
  • The training and validation are executed with CUDA 11.3 and PyTorch 1.10.
  • All models are trained with merely train split of SemanticKITTI Dataset.
  • Prediction from our models are directly used for evaluation, without employing any Test Time Augmentation or ensembling.
training time mIoU download
MinkowskiNet ~12.0 hours 70.04 model-737M
Cylinder3D ~8.7 hours 66.07 model-56M
SPVCNN ~13.1 hours 68.58 model-166M
RPVNet ~14.5 hours 68.86 model-980M

Waymo Open Dataset Representative Models

We are not supposed to provide pre-trained weights due to Waymo Dataset License Agreement, but you can easily achieve similar performance by training according to the default configs.

training time mIoU
MinkowskiNet ~25.0 hours 69.20
Cylinder3D ~19.2 hours 66.42
SPVCNN ~28.0 hours 69.37

Installation

Please refer to INSTALL.md for the installation details.

Data Preparation

└── data_root 
    └── nuscenes
    └── semantickitti
    └── scribblekitti
    └── waymo_open

Please refer to DATA_PREPARE.md for the details to prepare the nuScenes, SemanticKITTI, ScribbleKITTI, and Waymo Open datasets.

Getting Started

Please refer to GET_STARTED.md to learn more usage about this codebase.

Visualization

We recently supported a OpenPCSeg visualization tool for Waymo Open Dataset, please check INFER_WAYMO.md.

Here are some inference & visualization results:

Citation

If you find this work helpful, please kindly consider citing:

@misc{openpcseg2023,
    title={OpenPCSeg: An Open Source Point Cloud Segmentation Codebase},
    author={Liu Youquan, Bai Yeqi, Kong Lingdong, Chen Runnan, Hou Yuenan, Shi Botian, Li Yikang},
    howpublished = {\url{https://github.com/PJLab-ADG/PCSeg}},
    year={2023}
}

Authors

Liu Youquan, Bai Yeqi†, Kong Lingdong, Chen Runnan, Hou Yuenan, Shi Botian, Li Yikang

†Project Lead

License

OpenPCSeg is released under the Apache 2.0 license, while some specific operations in this codebase might be with other licenses. Please refer to LICENSE for a more careful check, if you are using our code for commercial matters.

Contact

If you have questions about this repo, please contact Bai Yeqi ([email protected]) or Shi Botian ([email protected]).

Acknowledgement

The overall structure of this repo is derived from OpenPCDet.

Part of our implementation uses code from repositories below:

Thank the authors for their great work!

openpcseg's People

Contributors

bai-yeqi avatar friskit-china 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  avatar  avatar

openpcseg's Issues

custom learning map support (semantic kitti)?

Thank you for this great repo!

I have a couple of questions regarding training, inference and learning map from semantic-kitti.yaml. The number of classes are hard coded in cfgs/<MODEL>.yaml and semantickitti_utils.py, while the class probabilities (See 'content' in this config file) are not used for loss regularization? Did I understand this correctly?

For example, SalsaNext accepts a user specified semantic-kitti.yaml that contains learning map, class probabilities, color information etc during training. For inference, the same file has to be used for accurate results. Do you plan on supporting this? I am willing to help you with this, under the assumption that I understand your codebase correctly

Update: found the hardcoded weights

ZeroDivisionError: division by zero

Hello! I encountered an error while running the training file:
(pcseg) root@9e1fedc6ce4f :/workspace/data/OpenPCSeg master # Python train. py -- cfg_file tools/cfgs/voxel/semantic_kitti/inkunt_mk34_cr10. yaml
2024-04-16 11:44:23277 INFO ********************************** Start logging**********************
2024-04-16 11:44:23277 INFO CUDA_VISIBLE-DEVICES=ALL
2024-04-16 11:44:23277 INFO cfg_file tools/cfgs/voxel/semantic_kitti/inkunt_mk34_cr10. yaml
2024-04-16 11:44:23278 INFO extra_tag default
April 16, 2024 11:44:23278 INFO set_cfgs None
2024-04-16 11:44:23278 INFO fix_random_seed False
April 16, 2024 11:44:23278 INFO batch_size 12
April 16, 2024 11:44:23279 INFO epochs 36
2024-04-16 11:44:23279 INFO sync_bn False
April 16, 2024 11:44:23279 INFO ckp None
April 16, 2024 11:44:23279 INFO pretrained model None
April 16, 2024 11:44:23280 INFO amp False
April 16, 2024 11:44:23280 INFO ckp_save-interval 1
April 16, 2024 11:44:23280 INFO max_ckp_savenum 30
2024-04-16 11:44:23280 INFO merge-all_iters.to_one_epoch False
April 16, 2024 11:44:23281 INFO eval False
April 16, 2024 11:44:23281 INFO eval_interval 50
April 16, 2024 11:44:23281 INFO workers 5
2024-04-16 11:44:23281 INFO local_rank 0
April 16, 2024 11:44:23282 INFO launcher none
April 16, 2024 11:44:23282 INFO tcd_port 18888
April 16, 2024 11:44:23282 INFO cfg ROOTDIR:/workspace/data/OpenPCSeg master
April 16, 2024 11:44:23282 INFO cfg LOCAL-RANK: 0
April 16, 2024 11:44:23282 INFO cfg MODALITY: voxel
April 16, 2024 11:44:23283 INFO
Cfg DATA=edit()
April 16, 2024 11:44:23283 INFO cfg DATA DATASET: Semantickitti
April 16, 2024 11:44:23283 INFO cfg DATA PETRELOSS-CONFIG: None
April 16, 2024 11:44:23283 INFO cfg DATA DATA-PATH:/workspace/data/SemanticKITTI/dataset/
April 16, 2024 11:44:23284 INFO cfg DATA VOXEL_SIZE: 0.05
April 16, 2024 11:44:23284 INFO cfg DATA AUGMENT: GlobalAugust LP
April 16, 2024 11:44:23284 INFO cfg DATA NUM-POINTS: 1000000
April 16, 2024 11:44:23284 INFO cfg DATA TRAINVAL: False
April 16, 2024 11:44:23284 INFO cfg DATA TTA: False
April 16, 2024 11:44:23285 INFO
Cfg MODEL=edit()
April 16, 2024 11:44:23285 INFO cfg MODEL NAME: MinkUNet
April 16, 2024 11:44:23285 INFO cfg MODEL IGNORE-LABEL: 0
April 16, 2024 11:44:23285 INFO cfg MODEL IN-FEATUREDIM: 4
April 16, 2024 11:44:23285 INFO cfg MODEL Block: ResBlock
April 16, 2024 11:44:23286 INFO cfg MODEL NUM-LAYER: [2, 3, 4, 6, 2, 2, 2, 2, 2]
April 16, 2024 11:44:23286 INFO cfg MODEL Plans: [32, 32, 64, 128, 256, 256, 128, 96, 96]
April 16, 2024 11:44:23286 INFO cfg MODEL.cr: 1.0
April 16, 2024 11:44:23286 INFO cfg MODEL DROPOUT-P: 0.0
April 16, 2024 11:44:23286 INFO cfg MODEL LABEL_SMOOTING: 0.1
April 16, 2024 11:44:23287 INFO cfg MODEL IF-DIST: True
April 16, 2024 11:44:23287 INFO
Cfg OPTIM=edit()
April 16, 2024 11:44:23287 INFO cfg OPTIM BATCH-SIZE-PER_GPU: 12
April 16, 2024 11:44:23287 INFO cfg OPTIM NUM-EPOCHS: 36
April 16, 2024 11:44:23288 INFO cfg OPTIM Optimizer: sgd
April 16, 2024 11:44:23288 INFO cfg OPTIM LR-PER-SAMPLE: 0.02
April 16, 2024 11:44:23288 INFO cfg OPTIM WEIGHT-DECAY: 0.0001
April 16, 2024 11:44:23288 INFO cfg OPTIM MOmentUM: 0.9
April 16, 2024 11:44:23288 INFO cfg OPTIM NESTEROV: True
April 16, 2024 11:44:23289 INFO cfg OPTIM GRAD.NORL_CLIP: 10
April 16, 2024 11:44:23289 INFO cfg OPTIM SCHEDULER: linear_warmup_with_codecay
April 16, 2024 11:44:23289 INFO cfg OPTIM WARMUP_EPOCH: 1
April 16, 2024 11:44:23289 INFO cfg OPTIM LR: 0.24
April 16, 2024 11:44:23289 INFO cfg TAG: minkunet_mk34_cr10
April 16, 2024 11:44:23290 INFO cfg EXP_GROUP-PATH: voxel/semantics_kitti
The total sample is 0
Fine grained version!!!
Traceback (most recent call last):
File "train. py", line 573, in
Main()
File "train. py", line 548, in main
Trainer=Trainer (args, cfgs)
File "train. py", line 189, in __ init__
Optim_cfg=cfgs OPTIM,
File "/workspace/data/OpenPCSeg master/pcseg/optim/__ init__. py", line 127, in build_scheduler
Lr_lambda=lambda x: linear_warmup with cosdecoy (x, warmup steps, total steps),
File "/root/miniconde3/envs/pcseg/lib/python3.7/site packages/torch/optim/lr_scheduler. py", line 203, in __ init__
Super (LambdaLR, self)__ Init__ (optimizer, last_epoch, verbose)
File "/root/miniconde3/envs/pcseg/lib/python3.7/site packages/torch/optim/lr_scheduler. py", line 77, in __ init__
Self. step()
File "/root/miniconde3/envs/pcseg/lib/python3.7/site packages/torch/optim/lr_scheduler. py", line 152, in step
Values=self. get_lr()
File "/root/miniconde3/envs/pcseg/lib/python3.7/site packages/torch/optim/lr_scheduler. py", line 251, in get_lr
For lmbda, base_lr in zip (self. lr_lambdas, self. base_lrs)]
File "/root/miniconde3/envs/pcseg/lib/python3.7/site packages/torch/optim/lr_scheduler. py", line 251, in
For lmbda, base_lr in zip (self. lr_lambdas, self. base_lrs)]
File "/workspace/data/OpenPCSeg master/pcseg/optim/__ init__. py", line 127, in
Lr_lambda=lambda x: linear_warmup with cosdecoy (x, warmup steps, total steps),
File "/workspace/data/OpenPCSeg master/pcseg/optim/__ init__. py", line 77, in linear_warmup_with cosdecay
Ratio=(cur_step - warmup.steps)/total_steps
ZeroDivisionError: division by zero

The code for running the training file is:
python train.py --cfg_file tools/cfgs/voxel/semantic_kitti/minkunet_mk34_cr10.yaml

I would like to ask, what are the possible reasons for this error to occur? I have checked my dataset path and there should be no problem, but I am not sure what other reasons are. Thank you

why num_points must always bigger than self.num_points

_, inds, inverse_map = sparse_quantize(pc_, return_index=True, return_inverse=True) if self.training and len(inds) > self.num_points: # NOTE: num_points must always bigger than self.num_points raise RuntimeError('droping point') inds = np.random.choice(inds, self.num_points, replace=False)

您好,这部分代码来自于semantickitti_fusion,这里是想说一个sample中的点数必须大于self.num_points,然后进行采样来让每个样本都使用self.num_points个点训练吗,如果是希望采样的话又为什么要返回runtimeerror,如果是希望self.num_points限制数据最大点数,这个 num_points must always bigger than self.num_points又是为什么,这部分有点弄不清楚,希望得到您的解答,感谢。

Could you provide related codes for demo test?

Hi, team

Thanks for your great codebase! It is really helpful for reproducing and comparing different segmentation models.

Could you provide some codes for demo test on one point cloud or point cloud sequences like OpenPCDet?

SoTA results config file

I‘m want to reproduce the SoTA result(mIoU=75.2) of LiDAR semantic segmentation on SemanticKITTI, could you tell me which config file should I use to train the model?

While following install guide: undefined symbol: iJIT_NotifyEvent

When reaching this point in the installation guide: pip install ./torchsparse

I get the following error:
Looking in indexes: https://pypi.org/simple, https://nexus.aimotive.com/repository/pypi-aim/simple
Processing ./torchsparse
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
Traceback (most recent call last):
File "", line 36, in
File "", line 34, in
File "/home/ad.adasworks.com/balazs.szolar/Projects/LidarCloudInvestigation/OpenPCSeg/package/torchsparse/setup.py", line 4, in
import torch
File "/home/ad.adasworks.com/balazs.szolar/miniforge3/envs/pcseg/lib/python3.7/site-packages/torch/init.py", line 197, in
from torch._C import * # noqa: F403
ImportError: /home/ad.adasworks.com/balazs.szolar/miniforge3/envs/pcseg/lib/python3.7/site-packages/torch/lib/libtorch_cpu.so: undefined symbol: iJIT_NotifyEvent
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

It seems to be some kind of problem with the pytorch installation.

Could you help with this issue?

nuscenes

Hello, when will the code related to training and testing on nuscenes be published

rangelib_cuda ImportError: DLL load failed while importing rangelib_cuda: 找不到指定的模块。

win10成功安装rangelib后,执行train.py报错ImportError: DLL load failed while importing rangelib_cuda: 找不到指定的模块。
具体报错信息如下:
Traceback (most recent call last):
File "D:/AI/Models/PCSeg-master/train.py", line 18, in
from pcseg.model import build_network, load_data_to_gpu
File "D:\AI\Models\PCSeg-master\pcseg\model_init_.py", line 6, in
from .segmentor import build_segmentor
File "D:\AI\Models\PCSeg-master\pcseg\model\segmentor_init_.py", line 20, in
from .fusion.rpvnet.rpvnet import RPVNet
File "D:\AI\Models\PCSeg-master\pcseg\model\segmentor\fusion\rpvnet_init_.py", line 1, in
from .rpvnet import RPVNet
File "D:\AI\Models\PCSeg-master\pcseg\model\segmentor\fusion\rpvnet\rpvnet.py", line 27, in
import range_utils.nn.functional as rnf
File "D:\AI\software\Anaconda\envs\torch1.7py3.8\lib\site-packages\rangelib-1.0.0-py3.8-win-amd64.egg\range_utils\nn\functional_init_.py", line 1, in
from .map_count import *
File "D:\AI\software\Anaconda\envs\torch1.7py3.8\lib\site-packages\rangelib-1.0.0-py3.8-win-amd64.egg\range_utils\nn\functional\map_count.py", line 3, in
import rangelib_cuda
ImportError: DLL load failed while importing rangelib_cuda: 找不到指定的模块。

Sparsetensor to Densetensor

Hi,Thanks for your great codebase!
How can I convert the SparseTensor from a model to DenseTensor? Can you give me an example?
Looking forward to your reply!

Reproduce Waymo segmentation results.

Thanks for your great work. I try to reproduce mIoU=69.20 for cfgs/voxel/waymo/minkunet_mk34_cr16.yaml. I use 2x A6000 with the default training schedule, batch_size=1 epochs=12, my reproduced results have mIoU<30. May you share some training details for waymo dataset, about the training schedule and GPUs. Besides, I can reproduce results of minkowskinet on semantickitti dataset.

ValueError: num samples should be a positive integer value, but got num samples=0

I run the train.py with the command line:
python train.py --cfg-file tools/cfgs/voxel/semantic_kitti/minkunet_mk34_cr10.yaml

and some wrong info occurs.
Anyone else has account the same situation
File "/home/**/anaconda3/envs/pcseg/lib/python3.7/site-packages/torch/utils/data/sampler,init"value, but got num samples={}".format(self.num samples) ValueError: num samples should be a positive integer value, but got num samples=0

安装步骤问题

非常感谢你们的开源仓库!
但是安装步骤4.2 conda install pytorch-scatter -c pyg 有问题,这样安装会把torch替换成cpu版本的。
应该pip install torch-scatter==2.0.9

train problem

Hi Team,
I now want to learn how to use the OpenSeg open source toolbox, and I am currently trying to use the Rangnet++ algorithm in the toolbox for training, and after modifying the DATA_PATH parameters in /OpenPCSeg/tools/cfgs/range/rangenet_darknet53.yaml, the following error is reported after executing the python train.py:
微信图片_20240322234123

Could this be a matter of the construction of the dataset, and is there a more detailed distribution of the dataset? Mainly because the arrangement is different from that on the official website. Or is there something wrong? The environment is the same as INSTALL.md.
Please take a look and get back to me
Thank you

AttributeError: 'Tensor' object has no attribute 'feats'

I run the train.py with the command line:
python train.py --cfg_file tools/cfgs/fusion/semantic_kitti/rpvnet_mk18_cr10.yaml
and some wrong info occurs.
Anyone else has account the same situation
File "/home/*/anaconda3/envs/pcseg/lib/python3.7/site-packages/torchsparse/nn/utils/apply.py", line 12, in fapply
feats = fn(input.feats, *args, **kwargs)
AttributeError: 'Tensor' object has no attribute 'feats'

Installing TorchSparse Library

Hi, I want to run the code however, I conflict with some problems while installing TorchSparse Library.

I followed the guide from the INSTALL.md file while installing the necessary library.

When I run the pip install ./torchsparse command

I got error like this.

error: command 'gcc' failed with exit status 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for torchsparse
Running setup.py clean for torchsparse
Failed to build torchsparse
ERROR: Could not build wheels for torchsparse, which is required to install pyproject.toml-based projects

So, I tried another way to install the torchsparse which satisfies pytorch=1.10.0, cudatoolkit=11.3

But, while I run the code I got error like this.

ImportError: cannot import name 'PointTensor' from 'torchsparse'

So, is there any other way to install TorchSparse-1.4.0 ?

Incompatible of optimizer parameters

Hi team,

Can you please test the RPVNet pretrained model
I imported it and use the same config but there is an error as below:
image

The environment is the same as in INSTALL.md btw.
Please take a look and reply me
Thank you

Code Release

Thanks for your interesting work! When will the code (UniSeg) be released?

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.