{"id":13444090,"url":"https://github.com/corochann/chainer-pointnet","last_synced_at":"2025-04-14T09:21:59.469Z","repository":{"id":70904301,"uuid":"135648815","full_name":"corochann/chainer-pointnet","owner":"corochann","description":"Chainer implementation of PointNet, PointNet++, KD-Network and 3DContextNework","archived":false,"fork":false,"pushed_at":"2018-07-18T00:45:27.000Z","size":132,"stargazers_count":35,"open_issues_count":1,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-27T22:42:57.670Z","etag":null,"topics":["chainer","classification","cupy","deep-learning","deep-neural-networks","pointnet","segmentation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/corochann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-06-01T00:33:57.000Z","updated_at":"2025-03-13T16:44:04.000Z","dependencies_parsed_at":"2023-02-23T23:15:22.755Z","dependency_job_id":null,"html_url":"https://github.com/corochann/chainer-pointnet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corochann%2Fchainer-pointnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corochann%2Fchainer-pointnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corochann%2Fchainer-pointnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corochann%2Fchainer-pointnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/corochann","download_url":"https://codeload.github.com/corochann/chainer-pointnet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248852192,"owners_count":21171843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chainer","classification","cupy","deep-learning","deep-neural-networks","pointnet","segmentation"],"created_at":"2024-07-31T03:02:18.719Z","updated_at":"2025-04-14T09:21:59.436Z","avatar_url":"https://github.com/corochann.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# chainer-pointnet\n\nVarious point cloud based deep neural network implementation by \n[Chainer](https://github.com/chainer/chainer) [1].\n\nIt includes PointNet, PointNet++, Kd-Network and Kd context net (3DContextNet).\n\n## Installation\n\nPlease install [Chainer](https://github.com/chainer/chainer) \n(and [cupy](https://github.com/cupy/cupy) if you want to use GPU) beforehand,\n```bash\n# Install chainer\npip install chainer\n\n# Install cupy if you use GPU (please change based on your CUDA version)\n# For example, if you use CUDA 8.0,\npip install cupy-cuda80\n# similarly cupy-cuda90 or cupy-cuda91 is avaialble.\n```\n\nand then type following to install master branch.\n\n```bash\ngit clone https://github.com/corochann/chainer-pointnet.git\npip install -e chainer-pointnet\n```\n\nAlso, some extension library is used in some of the code,\n```bash\n# Chainer Chemistry\ngit clone https://github.com/pfnet-research/chainer-chemistry.git\npip install -e chainer-chemistry\n# ChainerEX\ngit clone https://github.com/corochann/chainerex.git\npip install -e chainerex\n```\n\n\n## Model structure\n\n### PointNet [2]\n\nImplementations are in `models/pointnet`.\n\nBoth classification and segmentation network are implemented.\n\n`models/pointnet_cls` can be used for classification task.\n`trans` option represents to use `TransformNet` or not.\n`trans=False` corresponds `PointNetVanilla` (basic),\nand `trans=True` corresponds `PointNet` in the paper, respectively.\n\nIn my experiment `PointNetVanilla` performs already very well,\nthe gain in `PoinetNet` is few (maybe only 1-2% gain) while computation becomes\n much huge (around 3 times slower).\n \nOriginal implementation (in tensorflow) can be found on github under MIT license.\n\n - [charlesq34/pointnet](https://github.com/charlesq34/pointnet)\n\n#### tips\n\nI found the batch normalizations in the last linear layers are quite important.\nThe accuracy dramatically changes (10% or more) with BatchNormalization at FC\nlayers.\n\n### PointNet++ [3]\n\nImplementations are in `models/pointnet2`.\n\nBoth classification and segmentation network are implemented.\n\nJust note that thanks to [cupy](https://github.com/cupy/cupy), \nthere is no C language implementation for farthest point sampling, grouping or \nfeature propagation on GPU. \nYou don't need to build any C binary to use this function.\nPlease refer `utils/sampling.py` and `utils/grouping.py` for sampling \u0026 grouping.\n\nOriginal implementation (in tensorflow) can be found on github under MIT license.\n\n - [charlesq34/pointnet2](https://github.com/charlesq34/pointnet2)\n\n\n### Kd-Network [4]\n\nImplementations are in `models/kdnet`\n\nBoth classification and segmentation network are implemented.\n\n[Original implementation](https://github.com/Regenerator/kdnets) \nconstructs KDTree by their own implementation, \nwhich supports random splitting.\n\nHowever in my implementation, `scipy.spatial.cKDTree` is used for \neasy and faster implementation, by following [fxia22/kdnet.pytorch](https://github.com/fxia22/kdnet.pytorch).\nSo implementation in this repo does not support random tree splitting.\n\nOriginal implementation (in tensorflow) can be found on github under MIT license.\n\n - [Regenerator/kdnets](https://github.com/Regenerator/kdnets)\n\nAlso, pytorch implementations can be found on github\n\n - [fxia22/kdnet.pytorch](https://github.com/fxia22/kdnet.pytorch)\n\n### Kd Context Network (3DContextNet) [7]\n\nOriginally called 3DContextNet, but I named `KDContextNet` in my python program.\n\nImplementations are in `models/kdcontextnet`\n\nBoth classification and segmentation network are implemented.\n\nI could not find the implementation so far, and this is \"inferred\" \nimplementation. \nEspecially for segmentation part, how to \"upsample\" is not written in detail.\nSo this implementation might be different from author's implementation.\n\n## Experiments\n\nExperiments in each dataset is located under `expriments` folder.\nEach folder is independent, so you can refer independently.\n\n### ModelNet40 [5]\n\nThis is point cloud classification task of 40 category.\nDownload script \u0026 code is from [charlesq34/pointnet](https://github.com/charlesq34/pointnet)\n\n - http://modelnet.cs.princeton.edu/\n\nThe dataset is automatically downloaded and preprocessed. \nDataset shape is `train: (9840, 3, num_point=1024, 1), test (2468, 3, num_point=1024, 1)`.\n`ch=3`, meaning it only contains `(x, y, z)` coordinate information.\n\nYou can simply execute train code to train `PointNet` or `PointNetVanilla`.\n\n```angular2html\n# use gpu with id 0, train PointNetVanilla\n$ python train.py -g 0 --trans=false --method=point_cls --out=results/point_vanilla\n\n# use gpu with id 0, train PointNet \n$ python train.py -g 0 --method=point_cls --out=results/point\n\n# use gpu with id 0, train PointNet++ \n$ python train.py -g 0 --method=point2_cls_ssg --out=results/point2_ssg\n$ python train.py -g 0 --method=point2_cls_msg --out=results/point2_msg\n\n# use gpu with id 0, train KDNet \n$ python train.py -g 0 --method=kdnet_cls --dropout_ratio=0.3 --use_bn=1 --out=results/kdnet\n\n# use gpu with id 0, train KDContextNet \n$ python train.py -g 0 --method=kdcontextnet_cls --dropout_ratio=0.3 --use_bn=1 --out=results/kdcontextnet\npython train.py -g 0 --method=kdcontextnet_cls --dropout_ratio=0.3 --use_bn=1 --out=results/kdcontextnet_level369\n```\n\n```text\npython train.py --use_bn=1 --dropout_ratio=0.3\n# PointNetVanilla\nepoch       main/loss   main/cls_loss  main/trans_loss1  main/trans_loss2  main/accuracy  validation/main/loss  validation/main/accuracy  lr          elapsed_time\n250         0.111644    0.111644                                           0.958367       0.606223              0.872596                  1e-05       3560.81\n# PointNet\n250         0.119699    0.117399       0.00227531        2.40329e-05       0.95684        0.587751              0.871795                  1e-05       10358\n# PointNet2 SSG\n250         0.0226786                                                      0.989821       0.631495              0.898638                  1e-05       54240.2\n# PointNet2 MSG\n250         0.0217696                                                      0.991653       0.610621              0.892628                  1e-05       160451\n\n# KDNet with bn \u0026 dropout_ratio=0.3\n250         0.10106                                                        0.962235       1.01367               0.820913                  1e-05       20324\n# KDContextNet with bn \u0026 dropout_ratio=0.3\n250         0.126861                                                       0.952769       0.835642              0.825321                  1e-05       31900.6\n# KDContextNet with bn \u0026 dropout_ratio=0.3 \u0026 normalize=1 \u0026 residual=1\n250         0.0804102                                                      0.9716         0.824233              0.838542                  1e-05       28028.5\n```\n\nKDNet seems \"overfit\" to the train data, meaning that its representation power is strong but it fails to generalize to test data.\nMaybe this is due to its property of non-rotational invariance.\n\n### S3DIS [6]\n\nStanford Large-Scale 3D Indoor Spaces Dataset (S3DIS) for point cloud segmentation task.\nDownload the dataset from,\n\n - [S3DIS Dataset](http://buildingparser.stanford.edu/dataset.html)\n \nPrerocessing code adopted from [charlesq34/pointnet](https://github.com/charlesq34/pointnet)\nunder `third_party` directory.\n\nDataset shape:\n```text\ntrain shape (20291, 9, 4096, 1) (20291, 4096)\ntest  shape (3294, 9, 4096, 1) (3294, 4096)\n```\n`ch=9`, it contains `0-2 ch: XYZ, 3-5ch: RGB, 6-8 normalized XYZ` coordinate\ninformation respectively.\n\n\nSteps:\n\n1. Go to download link: download S3DIS dataset from\n [S3DIS Dataset](http://buildingparser.stanford.edu/dataset.html).\n You need to send application form.\n \n2. Download `Stanford3dDataset_v1.2_Aligned_Version.zip` file (4GB),\n place it under `s3dis/data` directory.\n\n2'. Fix mis label manually.\n\n`Stanford3dDataset_v1.2_Aligned_Version/Area_5/hallway_6/Annotations/ceiling_1.txt`\nhas wrong charcter at line 180389. Please fix it manually.\n\n3. Preprocessing\n\n`collect_indoor3d_data.py` is for data re-organization and \n`gen_indoor3d_h5.py` is to generate HDF5 files. (cite from [charlesq34/pointnet](https://github.com/charlesq34/pointnet/tree/master/sem_seg#dataset))\n\n```angular2html\n$ cd third_party\n$ python collect_indoor3d_data.py\n$ python gen_indoor3d_h5.py\n```\n\n4. Training\n\n```bash\n# use gpu with id 0, train PointNetVanilla\n$ python train.py -g 0 --method=point_seg --trans=false --out=results/pointnet_vanilla\n\n# use gpu with id 0, train PointNet \n$ python train.py -g 0 --method=point_seg --out=results/pointnet\n\n# use gpu with id 0, train PointNet++\n$ python train.py -g 0 --method=point2_seg_ssg --out=results/pointnet2\n\n# use gpu with id 0, train KDNet \n$ python train.py -g 0 --method=kdnet_seg --dropout_ratio=0 --use_bn=1\n$ python train.py -g 0 --method=kdnet_seg --dropout_ratio=0.3 --use_bn=1 --out=results/kdnet\n\n# use gpu with id 0, train KDContextNet \n$ python train.py -g 0 --method=kdcontextnet_seg --dropout_ratio=0.3 --use_bn=1 --out=results/kdcontextnet\n```\n\n```text\npython train.py --use_bn=1 --dropout_ratio=0.3\n# PointNetVanilla\nepoch       main/loss   main/cls_loss  main/trans_loss1  main/trans_loss2  main/accuracy  validation/main/loss  validation/main/accuracy  lr          elapsed_time\n250         0.0305516   0.0305516                                          0.988418       0.690604              0.891049                  1e-05       101405\n```\n\n### ScanNet\n\nPoint cloud semantic segmentation task of indoor scenes.\n\n - [ScanNet: Richly-annotated 3D Reconstructions of Indoor Scenes (CVPR 2017 Spotlight)](https://www.youtube.com/watch?v=Olx4OnoZWQQ)\n\n## LICENSE\nMIT License.\n\nNo warranty or support for this implementation.\nEach model performance is not guaranteed, and may not achieve the score reported in each paper. Use it at your own risk.\n\nPlease see the [LICENSE](https://github.com/corochann/chainer-pointnet/blob/master/LICENSE) file for details.\n\nI appreciate the authors who open sourced their code for the reference under permissive license.\n\n## Reference\n\n[1] Seiya Tokui, Kenta Oono, Shohei Hido, and Justin Clayton. \nChainer: a next-generation open source framework for deep learning. \nIn *Proceedings of Workshop on Machine Learning Systems (LearningSys) in Advances in Neural Information Processing System (NIPS) 28*, 2015.\n\n - [paper](http://learningsys.org/papers/LearningSys_2015_paper_33.pdf)\n - [official page](https://chainer.org/)\n - [code: chainer/chainer](https://github.com/chainer/chainer)\n\n[2] Qi, Charles R and Su, Hao and Mo, Kaichun and Guibas, Leonidas J.\nPointNet: Deep Learning on Point Sets for 3D Classification and Segmentation. \n*arXiv preprint arXiv:1612.00593*, 2016.\n\n - [paper on arXiv](https://arxiv.org/abs/1612.00593)\n - [project page](http://stanford.edu/~rqi/pointnet/)\n - [code: charlesq34/pointnet](https://github.com/charlesq34/pointnet)\n - CVPR oral\n\n[3] Qi, Charles R and Yi, Li and Su, Hao and Guibas, Leonidas J.\nPointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space. \n*arXiv preprint arXiv:1706.02413* 2017.\n\n - [paper on arXiv](https://arxiv.org/abs/1706.02413)\n - [project page](http://stanford.edu/~rqi/pointnet2/)\n - [code: charlesq34/pointnet2](https://github.com/charlesq34/pointnet2)\n - NIPS 2017\n\n[4] Roman, Klokov and Victor, Lempitsky. \nEscape from Cells: Deep Kd-Networks for the Recognition of 3D Point Cloud Models. \n*arXiv preprint arXiv:1704.01222* 2017.\n\n - [paper on arXiv](https://arxiv.org/abs/1704.01222)\n - [project page](http://sites.skoltech.ru/compvision/kdnets)\n - [code: Regenerator/kdnets](https://github.com/Regenerator/kdnets)\n - ICCV 2017\n\n[5] Z, Wu and S, Song and A, Khosla and F, Yu and L, Zhang and X, Tang and J, Xiao. \n3D ShapeNets: A Deep Representation for Volumetric Shapes. \nProceedings of 28th IEEE Conference on Computer Vision and Pattern Recognition (CVPR2015), 2015.\n\n - [project page](http://modelnet.cs.princeton.edu/)\n\n[6] Iro, Armeni and Alexander, Sax and Amir, R., Zamir and Silvio, Savarese. \nJoint 2D-3D-Semantic Data for Indoor Scene Understanding. \n*arXiv preprint arXiv:1702.01105* 2017.\n\n - [paper on arXiv](https://arxiv.org/abs/1702.01105)\n - [project page](http://buildingparser.stanford.edu/dataset.html)\n - [code: alexsax/2D-3D-Semantics](https://github.com/alexsax/2D-3D-Semantics)\n\n[7] Wei, Zeng and Theo, Gevers. \n3DContextNet: K-d Tree Guided Hierarchical Learning of Point Clouds Using Local and Global Contextual Cues. \n*arXiv preprint arXiv:1711.11379* 2017.\n\n - [paper on arXiv](https://arxiv.org/abs/1711.11379)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorochann%2Fchainer-pointnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorochann%2Fchainer-pointnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorochann%2Fchainer-pointnet/lists"}