ocnn 2.2.8__tar.gz → 2.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. {ocnn-2.2.8 → ocnn-2.3.0}/LICENSE +21 -21
  2. {ocnn-2.2.8 → ocnn-2.3.0}/MANIFEST.in +1 -1
  3. {ocnn-2.2.8/ocnn.egg-info → ocnn-2.3.0}/PKG-INFO +117 -111
  4. {ocnn-2.2.8 → ocnn-2.3.0}/README.md +88 -82
  5. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/__init__.py +24 -24
  6. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/dataset.py +160 -160
  7. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/models/__init__.py +29 -29
  8. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/models/autoencoder.py +155 -155
  9. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/models/hrnet.py +192 -192
  10. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/models/image2shape.py +128 -128
  11. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/models/lenet.py +46 -46
  12. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/models/ounet.py +94 -94
  13. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/models/resnet.py +53 -53
  14. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/models/segnet.py +72 -72
  15. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/models/unet.py +105 -105
  16. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/modules/__init__.py +26 -26
  17. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/modules/modules.py +303 -303
  18. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/modules/resblocks.py +158 -158
  19. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/nn/__init__.py +45 -44
  20. ocnn-2.3.0/ocnn/nn/kernels/__init__.py +14 -0
  21. ocnn-2.3.0/ocnn/nn/kernels/autotuner.py +416 -0
  22. ocnn-2.3.0/ocnn/nn/kernels/config.py +67 -0
  23. ocnn-2.3.0/ocnn/nn/kernels/conv_bwd_implicit_gemm.py +229 -0
  24. ocnn-2.3.0/ocnn/nn/kernels/conv_bwd_implicit_gemm_splitk.py +347 -0
  25. ocnn-2.3.0/ocnn/nn/kernels/conv_fwd_implicit_gemm.py +109 -0
  26. ocnn-2.3.0/ocnn/nn/kernels/conv_fwd_implicit_gemm_splitk.py +150 -0
  27. ocnn-2.3.0/ocnn/nn/kernels/utils.py +44 -0
  28. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/nn/octree2col.py +53 -53
  29. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/nn/octree2vox.py +50 -50
  30. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/nn/octree_align.py +46 -46
  31. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/nn/octree_conv.py +430 -429
  32. ocnn-2.3.0/ocnn/nn/octree_conv_t.py +148 -0
  33. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/nn/octree_drop.py +55 -55
  34. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/nn/octree_dwconv.py +222 -222
  35. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/nn/octree_gconv.py +79 -79
  36. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/nn/octree_interp.py +196 -196
  37. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/nn/octree_norm.py +126 -126
  38. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/nn/octree_pad.py +39 -39
  39. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/nn/octree_pool.py +200 -200
  40. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/octree/__init__.py +22 -22
  41. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/octree/octree.py +770 -770
  42. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/octree/points.py +384 -323
  43. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/octree/shuffled_key.py +115 -115
  44. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn/utils.py +205 -205
  45. {ocnn-2.2.8 → ocnn-2.3.0/ocnn.egg-info}/PKG-INFO +117 -111
  46. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn.egg-info/SOURCES.txt +9 -0
  47. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn.egg-info/not-zip-safe +1 -1
  48. {ocnn-2.2.8 → ocnn-2.3.0}/setup.cfg +9 -9
  49. {ocnn-2.2.8 → ocnn-2.3.0}/setup.py +35 -35
  50. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn.egg-info/dependency_links.txt +0 -0
  51. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn.egg-info/requires.txt +0 -0
  52. {ocnn-2.2.8 → ocnn-2.3.0}/ocnn.egg-info/top_level.txt +0 -0
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Peng-Shuai Wang <wangps@hotmail.com>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Peng-Shuai Wang <wangps@hotmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -1 +1 @@
1
- recursive-exclude test *
1
+ recursive-exclude test *
@@ -1,111 +1,117 @@
1
- Metadata-Version: 2.4
2
- Name: ocnn
3
- Version: 2.2.8
4
- Summary: Octree-based Sparse Convolutional Neural Networks
5
- Home-page: https://github.com/octree-nn/ocnn-pytorch
6
- Author: Peng-Shuai Wang
7
- Author-email: wangps@hotmail.com
8
- License: MIT
9
- Classifier: Programming Language :: Python :: 3
10
- Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.6
12
- Description-Content-Type: text/markdown
13
- License-File: LICENSE
14
- Requires-Dist: torch
15
- Requires-Dist: torchvision
16
- Requires-Dist: numpy
17
- Requires-Dist: packaging
18
- Dynamic: author
19
- Dynamic: author-email
20
- Dynamic: classifier
21
- Dynamic: description
22
- Dynamic: description-content-type
23
- Dynamic: home-page
24
- Dynamic: license
25
- Dynamic: license-file
26
- Dynamic: requires-dist
27
- Dynamic: requires-python
28
- Dynamic: summary
29
-
30
- # O-CNN
31
-
32
- **[Documentation](https://ocnn-pytorch.readthedocs.io)**
33
-
34
- [![Documentation Status](https://readthedocs.org/projects/ocnn-pytorch/badge/?version=latest)](https://ocnn-pytorch.readthedocs.io/en/latest/?badge=latest)
35
- [![Downloads](https://static.pepy.tech/badge/ocnn)](https://pepy.tech/project/ocnn)
36
- [![Downloads](https://static.pepy.tech/badge/ocnn/month)](https://pepy.tech/project/ocnn)
37
- [![PyPI](https://img.shields.io/pypi/v/ocnn)](https://pypi.org/project/ocnn/)
38
-
39
- This repository contains the **pure PyTorch**-based implementation of
40
- [O-CNN](https://wang-ps.github.io/O-CNN.html). The code has been tested with
41
- `Pytorch>=1.6.0`, and `Pytorch>=1.9.0` is preferred. The *original*
42
- implementation of O-CNN is based on C++ and CUDA and can be found
43
- [here](https://github.com/Microsoft/O-CNN), which has received
44
- [![stars - O-CNN](https://img.shields.io/github/stars/microsoft/O-CNN?style=social)](https://github.com/microsoft/O-CNN) and
45
- [![forks - O-CNN](https://img.shields.io/github/forks/microsoft/O-CNN?style=social)](https://github.com/microsoft/O-CNN).
46
-
47
-
48
- O-CNN is an octree-based 3D convolutional neural network framework for 3D data.
49
- O-CNN constrains the CNN storage and computation into non-empty sparse voxels
50
- for efficiency and uses the `octree` data structure to organize and index these
51
- sparse voxels. Currently, this type of 3D convolution is known as Sparse
52
- Convolution in the research community.
53
-
54
-
55
- The concept of Sparse Convolution in O-CNN is the same with
56
- [SparseConvNet](https://openaccess.thecvf.com/content_cvpr_2018/papers/Graham_3D_Semantic_Segmentation_CVPR_2018_paper.pdf),
57
- [MinkowskiNet](https://github.com/NVIDIA/MinkowskiEngine), and
58
- [SpConv](https://github.com/traveller59/spconv).
59
- The key difference is that our O-CNN uses `octrees` to index the sparse voxels,
60
- while these works use `Hash Tables`. However, I believe that `octrees` may be
61
- the right choice for Sparse Convolution. With `octrees`, I can implement the
62
- Sparse Convolution with pure PyTorch. More importantly, with `octrees`, I can
63
- also build efficient transformers for 3D data --
64
- [OctFormer](https://github.com/octree-nn/octformer), which is extremely hard
65
- with `Hash Tables`.
66
-
67
-
68
- Our O-CNN is published in SIGGRAPH 2017, SparseConvNet is published in CVPR
69
- 2018, and MinkowskiNet is published in CVPR 2019. Actually, our O-CNN was
70
- submitted to SIGGRAPH in the end of 2016 and was officially accepted in March,
71
- 2017. <!-- The camera-ready version of our O-CNN was submitted to SIGGRAPH in April, 2018. -->
72
- We just did not post our paper on Arxiv during the review process of SIGGRAPH.
73
- Therefore, **the idea of constraining CNN computation into sparse non-emtpry
74
- voxels, i.e. Sparse Convolution, is first proposed by our O-CNN**.
75
-
76
- <!--
77
- Developed in collaboration with authors from [PointCNN](https://arxiv.org/abs/1801.07791),
78
- [Dr. Yangyan Li](https://yangyan.li/) and [Prof. Baoquan Chen](https://baoquanchen.info/),
79
- -->
80
- This library supports point cloud processing from the ground up.
81
- The library provides essential components for converting raw point clouds into
82
- octrees to perform convolution operations. Of course, it also supports other 3D
83
- data formats, such as meshes and volumetric grids, which can be converted into
84
- octrees to leverage the library's capabilities.
85
-
86
-
87
- ## Key benefits of ocnn-pytorch
88
-
89
- - **Simplicity**. The ocnn-pytorch is based on pure PyTorch, it is portable and
90
- can be installed with a simple command:`pip install ocnn`. Other sparse
91
- convolution frameworks heavily rely on C++ and CUDA, and it is complicated to
92
- configure the compiling environment.
93
-
94
- - **Efficiency**. The ocnn-pytorch is very efficient compared with other sparse
95
- convolution frameworks. It only takes 18 hours to train the network on
96
- ScanNet for 600 epochs with 4 V100 GPUs. For reference, under the same
97
- training settings, MinkowskiNet 0.4.3 takes 60 hours and MinkowskiNet 0.5.4
98
- takes 30 hours.
99
-
100
- ## Citation
101
-
102
- ```bibtex
103
- @article {Wang-2017-ocnn,
104
- title = {{O-CNN}: Octree-based Convolutional Neural Networksfor {3D} Shape Analysis},
105
- author = {Wang, Peng-Shuai and Liu, Yang and Guo, Yu-Xiao and Sun, Chun-Yu and Tong, Xin},
106
- journal = {ACM Transactions on Graphics (SIGGRAPH)},
107
- volume = {36},
108
- number = {4},
109
- year = {2017},
110
- }
111
- ```
1
+ Metadata-Version: 2.4
2
+ Name: ocnn
3
+ Version: 2.3.0
4
+ Summary: Octree-based Sparse Convolutional Neural Networks
5
+ Home-page: https://github.com/octree-nn/ocnn-pytorch
6
+ Author: Peng-Shuai Wang
7
+ Author-email: wangps@hotmail.com
8
+ License: MIT
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.6
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: torch
15
+ Requires-Dist: torchvision
16
+ Requires-Dist: numpy
17
+ Requires-Dist: packaging
18
+ Dynamic: author
19
+ Dynamic: author-email
20
+ Dynamic: classifier
21
+ Dynamic: description
22
+ Dynamic: description-content-type
23
+ Dynamic: home-page
24
+ Dynamic: license
25
+ Dynamic: license-file
26
+ Dynamic: requires-dist
27
+ Dynamic: requires-python
28
+ Dynamic: summary
29
+
30
+ # O-CNN
31
+
32
+ **[Documentation](https://ocnn-pytorch.readthedocs.io)**
33
+
34
+ [![Documentation Status](https://readthedocs.org/projects/ocnn-pytorch/badge/?version=latest)](https://ocnn-pytorch.readthedocs.io/en/latest/?badge=latest)
35
+ [![Downloads](https://static.pepy.tech/badge/ocnn)](https://pepy.tech/project/ocnn)
36
+ [![Downloads](https://static.pepy.tech/badge/ocnn/month)](https://pepy.tech/project/ocnn)
37
+ [![PyPI](https://img.shields.io/pypi/v/ocnn)](https://pypi.org/project/ocnn/)
38
+
39
+ This repository contains the **pure PyTorch**-based implementation of
40
+ [O-CNN](https://wang-ps.github.io/O-CNN.html). The code has been tested with
41
+ `Pytorch>=1.6.0`, and `Pytorch>=1.9.0` is preferred. The *original*
42
+ implementation of O-CNN is based on C++ and CUDA and can be found
43
+ [here](https://github.com/Microsoft/O-CNN), which has received
44
+ [![stars - O-CNN](https://img.shields.io/github/stars/microsoft/O-CNN?style=social)](https://github.com/microsoft/O-CNN) and
45
+ [![forks - O-CNN](https://img.shields.io/github/forks/microsoft/O-CNN?style=social)](https://github.com/microsoft/O-CNN).
46
+
47
+
48
+ O-CNN is an octree-based 3D convolutional neural network framework for 3D data.
49
+ O-CNN constrains the CNN storage and computation into non-empty sparse voxels
50
+ for efficiency and uses the `octree` data structure to organize and index these
51
+ sparse voxels. Currently, this type of 3D convolution is known as Sparse
52
+ Convolution in the research community.
53
+
54
+
55
+ The concept of Sparse Convolution in O-CNN is the same with
56
+ [SparseConvNet](https://openaccess.thecvf.com/content_cvpr_2018/papers/Graham_3D_Semantic_Segmentation_CVPR_2018_paper.pdf),
57
+ [MinkowskiNet](https://github.com/NVIDIA/MinkowskiEngine), and
58
+ [SpConv](https://github.com/traveller59/spconv).
59
+ The key difference is that our O-CNN uses `octrees` to index the sparse voxels,
60
+ while these works use `Hash Tables`. However, I believe that `octrees` may be
61
+ the right choice for Sparse Convolution. With `octrees`, I can implement the
62
+ Sparse Convolution with pure PyTorch. More importantly, with `octrees`, I can
63
+ also build efficient transformers for 3D data --
64
+ [OctFormer](https://github.com/octree-nn/octformer), which is extremely hard
65
+ with `Hash Tables`.
66
+
67
+
68
+ Our O-CNN is published in SIGGRAPH 2017, SparseConvNet is published in CVPR
69
+ 2018, and MinkowskiNet is published in CVPR 2019. Actually, our O-CNN was
70
+ submitted to SIGGRAPH in the end of 2016 and was officially accepted in March,
71
+ 2017. <!-- The camera-ready version of our O-CNN was submitted to SIGGRAPH in April, 2018. -->
72
+ We just did not post our paper on Arxiv during the review process of SIGGRAPH.
73
+ Therefore, **the idea of constraining CNN computation into sparse non-emtpry
74
+ voxels, i.e. Sparse Convolution, is first proposed by our O-CNN**.
75
+
76
+ <!--
77
+ Developed in collaboration with authors from [PointCNN](https://arxiv.org/abs/1801.07791),
78
+ [Dr. Yangyan Li](https://yangyan.li/) and [Prof. Baoquan Chen](https://baoquanchen.info/),
79
+ -->
80
+ This library supports point cloud processing from the ground up.
81
+ The library provides essential components for converting raw point clouds into
82
+ octrees to perform convolution operations. Of course, it also supports other 3D
83
+ data formats, such as meshes and volumetric grids, which can be converted into
84
+ octrees to leverage the library's capabilities.
85
+
86
+ ## Updates
87
+
88
+ - **2026.02.02**: Release `v2.3.0`, incorporating Triton to accelerate
89
+ octree-based sparse convolution in the upcoming release. OctreeConv is even
90
+ **2.5 times faster than the latest spconv**!
91
+ - **2025.12.18**: Release `v2.2.8`, improving neighbor search efficiency.
92
+
93
+
94
+ ## Key benefits of ocnn-pytorch
95
+
96
+ - **Simplicity**. The ocnn-pytorch is based on pure PyTorch, it is portable and
97
+ can be installed with a simple command:`pip install ocnn`. Other sparse
98
+ convolution frameworks heavily rely on C++ and CUDA, and it is complicated to
99
+ configure the compiling environment.
100
+
101
+ - **Efficiency**. The ocnn-pytorch is very efficient compared with other sparse
102
+ convolution frameworks. It is **even 2.5 times faster than the latest spconv
103
+ implementation**! Check the benchmark [code](test/benchmark_conv.py) and
104
+ [results](test/benchmark/results.png) for details.
105
+
106
+ ## Citation
107
+
108
+ ```bibtex
109
+ @article {Wang-2017-ocnn,
110
+ title = {{O-CNN}: Octree-based Convolutional Neural Networksfor {3D} Shape Analysis},
111
+ author = {Wang, Peng-Shuai and Liu, Yang and Guo, Yu-Xiao and Sun, Chun-Yu and Tong, Xin},
112
+ journal = {ACM Transactions on Graphics (SIGGRAPH)},
113
+ volume = {36},
114
+ number = {4},
115
+ year = {2017},
116
+ }
117
+ ```
@@ -1,82 +1,88 @@
1
- # O-CNN
2
-
3
- **[Documentation](https://ocnn-pytorch.readthedocs.io)**
4
-
5
- [![Documentation Status](https://readthedocs.org/projects/ocnn-pytorch/badge/?version=latest)](https://ocnn-pytorch.readthedocs.io/en/latest/?badge=latest)
6
- [![Downloads](https://static.pepy.tech/badge/ocnn)](https://pepy.tech/project/ocnn)
7
- [![Downloads](https://static.pepy.tech/badge/ocnn/month)](https://pepy.tech/project/ocnn)
8
- [![PyPI](https://img.shields.io/pypi/v/ocnn)](https://pypi.org/project/ocnn/)
9
-
10
- This repository contains the **pure PyTorch**-based implementation of
11
- [O-CNN](https://wang-ps.github.io/O-CNN.html). The code has been tested with
12
- `Pytorch>=1.6.0`, and `Pytorch>=1.9.0` is preferred. The *original*
13
- implementation of O-CNN is based on C++ and CUDA and can be found
14
- [here](https://github.com/Microsoft/O-CNN), which has received
15
- [![stars - O-CNN](https://img.shields.io/github/stars/microsoft/O-CNN?style=social)](https://github.com/microsoft/O-CNN) and
16
- [![forks - O-CNN](https://img.shields.io/github/forks/microsoft/O-CNN?style=social)](https://github.com/microsoft/O-CNN).
17
-
18
-
19
- O-CNN is an octree-based 3D convolutional neural network framework for 3D data.
20
- O-CNN constrains the CNN storage and computation into non-empty sparse voxels
21
- for efficiency and uses the `octree` data structure to organize and index these
22
- sparse voxels. Currently, this type of 3D convolution is known as Sparse
23
- Convolution in the research community.
24
-
25
-
26
- The concept of Sparse Convolution in O-CNN is the same with
27
- [SparseConvNet](https://openaccess.thecvf.com/content_cvpr_2018/papers/Graham_3D_Semantic_Segmentation_CVPR_2018_paper.pdf),
28
- [MinkowskiNet](https://github.com/NVIDIA/MinkowskiEngine), and
29
- [SpConv](https://github.com/traveller59/spconv).
30
- The key difference is that our O-CNN uses `octrees` to index the sparse voxels,
31
- while these works use `Hash Tables`. However, I believe that `octrees` may be
32
- the right choice for Sparse Convolution. With `octrees`, I can implement the
33
- Sparse Convolution with pure PyTorch. More importantly, with `octrees`, I can
34
- also build efficient transformers for 3D data --
35
- [OctFormer](https://github.com/octree-nn/octformer), which is extremely hard
36
- with `Hash Tables`.
37
-
38
-
39
- Our O-CNN is published in SIGGRAPH 2017, SparseConvNet is published in CVPR
40
- 2018, and MinkowskiNet is published in CVPR 2019. Actually, our O-CNN was
41
- submitted to SIGGRAPH in the end of 2016 and was officially accepted in March,
42
- 2017. <!-- The camera-ready version of our O-CNN was submitted to SIGGRAPH in April, 2018. -->
43
- We just did not post our paper on Arxiv during the review process of SIGGRAPH.
44
- Therefore, **the idea of constraining CNN computation into sparse non-emtpry
45
- voxels, i.e. Sparse Convolution, is first proposed by our O-CNN**.
46
-
47
- <!--
48
- Developed in collaboration with authors from [PointCNN](https://arxiv.org/abs/1801.07791),
49
- [Dr. Yangyan Li](https://yangyan.li/) and [Prof. Baoquan Chen](https://baoquanchen.info/),
50
- -->
51
- This library supports point cloud processing from the ground up.
52
- The library provides essential components for converting raw point clouds into
53
- octrees to perform convolution operations. Of course, it also supports other 3D
54
- data formats, such as meshes and volumetric grids, which can be converted into
55
- octrees to leverage the library's capabilities.
56
-
57
-
58
- ## Key benefits of ocnn-pytorch
59
-
60
- - **Simplicity**. The ocnn-pytorch is based on pure PyTorch, it is portable and
61
- can be installed with a simple command:`pip install ocnn`. Other sparse
62
- convolution frameworks heavily rely on C++ and CUDA, and it is complicated to
63
- configure the compiling environment.
64
-
65
- - **Efficiency**. The ocnn-pytorch is very efficient compared with other sparse
66
- convolution frameworks. It only takes 18 hours to train the network on
67
- ScanNet for 600 epochs with 4 V100 GPUs. For reference, under the same
68
- training settings, MinkowskiNet 0.4.3 takes 60 hours and MinkowskiNet 0.5.4
69
- takes 30 hours.
70
-
71
- ## Citation
72
-
73
- ```bibtex
74
- @article {Wang-2017-ocnn,
75
- title = {{O-CNN}: Octree-based Convolutional Neural Networksfor {3D} Shape Analysis},
76
- author = {Wang, Peng-Shuai and Liu, Yang and Guo, Yu-Xiao and Sun, Chun-Yu and Tong, Xin},
77
- journal = {ACM Transactions on Graphics (SIGGRAPH)},
78
- volume = {36},
79
- number = {4},
80
- year = {2017},
81
- }
82
- ```
1
+ # O-CNN
2
+
3
+ **[Documentation](https://ocnn-pytorch.readthedocs.io)**
4
+
5
+ [![Documentation Status](https://readthedocs.org/projects/ocnn-pytorch/badge/?version=latest)](https://ocnn-pytorch.readthedocs.io/en/latest/?badge=latest)
6
+ [![Downloads](https://static.pepy.tech/badge/ocnn)](https://pepy.tech/project/ocnn)
7
+ [![Downloads](https://static.pepy.tech/badge/ocnn/month)](https://pepy.tech/project/ocnn)
8
+ [![PyPI](https://img.shields.io/pypi/v/ocnn)](https://pypi.org/project/ocnn/)
9
+
10
+ This repository contains the **pure PyTorch**-based implementation of
11
+ [O-CNN](https://wang-ps.github.io/O-CNN.html). The code has been tested with
12
+ `Pytorch>=1.6.0`, and `Pytorch>=1.9.0` is preferred. The *original*
13
+ implementation of O-CNN is based on C++ and CUDA and can be found
14
+ [here](https://github.com/Microsoft/O-CNN), which has received
15
+ [![stars - O-CNN](https://img.shields.io/github/stars/microsoft/O-CNN?style=social)](https://github.com/microsoft/O-CNN) and
16
+ [![forks - O-CNN](https://img.shields.io/github/forks/microsoft/O-CNN?style=social)](https://github.com/microsoft/O-CNN).
17
+
18
+
19
+ O-CNN is an octree-based 3D convolutional neural network framework for 3D data.
20
+ O-CNN constrains the CNN storage and computation into non-empty sparse voxels
21
+ for efficiency and uses the `octree` data structure to organize and index these
22
+ sparse voxels. Currently, this type of 3D convolution is known as Sparse
23
+ Convolution in the research community.
24
+
25
+
26
+ The concept of Sparse Convolution in O-CNN is the same with
27
+ [SparseConvNet](https://openaccess.thecvf.com/content_cvpr_2018/papers/Graham_3D_Semantic_Segmentation_CVPR_2018_paper.pdf),
28
+ [MinkowskiNet](https://github.com/NVIDIA/MinkowskiEngine), and
29
+ [SpConv](https://github.com/traveller59/spconv).
30
+ The key difference is that our O-CNN uses `octrees` to index the sparse voxels,
31
+ while these works use `Hash Tables`. However, I believe that `octrees` may be
32
+ the right choice for Sparse Convolution. With `octrees`, I can implement the
33
+ Sparse Convolution with pure PyTorch. More importantly, with `octrees`, I can
34
+ also build efficient transformers for 3D data --
35
+ [OctFormer](https://github.com/octree-nn/octformer), which is extremely hard
36
+ with `Hash Tables`.
37
+
38
+
39
+ Our O-CNN is published in SIGGRAPH 2017, SparseConvNet is published in CVPR
40
+ 2018, and MinkowskiNet is published in CVPR 2019. Actually, our O-CNN was
41
+ submitted to SIGGRAPH in the end of 2016 and was officially accepted in March,
42
+ 2017. <!-- The camera-ready version of our O-CNN was submitted to SIGGRAPH in April, 2018. -->
43
+ We just did not post our paper on Arxiv during the review process of SIGGRAPH.
44
+ Therefore, **the idea of constraining CNN computation into sparse non-emtpry
45
+ voxels, i.e. Sparse Convolution, is first proposed by our O-CNN**.
46
+
47
+ <!--
48
+ Developed in collaboration with authors from [PointCNN](https://arxiv.org/abs/1801.07791),
49
+ [Dr. Yangyan Li](https://yangyan.li/) and [Prof. Baoquan Chen](https://baoquanchen.info/),
50
+ -->
51
+ This library supports point cloud processing from the ground up.
52
+ The library provides essential components for converting raw point clouds into
53
+ octrees to perform convolution operations. Of course, it also supports other 3D
54
+ data formats, such as meshes and volumetric grids, which can be converted into
55
+ octrees to leverage the library's capabilities.
56
+
57
+ ## Updates
58
+
59
+ - **2026.02.02**: Release `v2.3.0`, incorporating Triton to accelerate
60
+ octree-based sparse convolution in the upcoming release. OctreeConv is even
61
+ **2.5 times faster than the latest spconv**!
62
+ - **2025.12.18**: Release `v2.2.8`, improving neighbor search efficiency.
63
+
64
+
65
+ ## Key benefits of ocnn-pytorch
66
+
67
+ - **Simplicity**. The ocnn-pytorch is based on pure PyTorch, it is portable and
68
+ can be installed with a simple command:`pip install ocnn`. Other sparse
69
+ convolution frameworks heavily rely on C++ and CUDA, and it is complicated to
70
+ configure the compiling environment.
71
+
72
+ - **Efficiency**. The ocnn-pytorch is very efficient compared with other sparse
73
+ convolution frameworks. It is **even 2.5 times faster than the latest spconv
74
+ implementation**! Check the benchmark [code](test/benchmark_conv.py) and
75
+ [results](test/benchmark/results.png) for details.
76
+
77
+ ## Citation
78
+
79
+ ```bibtex
80
+ @article {Wang-2017-ocnn,
81
+ title = {{O-CNN}: Octree-based Convolutional Neural Networksfor {3D} Shape Analysis},
82
+ author = {Wang, Peng-Shuai and Liu, Yang and Guo, Yu-Xiao and Sun, Chun-Yu and Tong, Xin},
83
+ journal = {ACM Transactions on Graphics (SIGGRAPH)},
84
+ volume = {36},
85
+ number = {4},
86
+ year = {2017},
87
+ }
88
+ ```
@@ -1,24 +1,24 @@
1
- # --------------------------------------------------------
2
- # Octree-based Sparse Convolutional Neural Networks
3
- # Copyright (c) 2022 Peng-Shuai Wang <wangps@hotmail.com>
4
- # Licensed under The MIT License [see LICENSE for details]
5
- # Written by Peng-Shuai Wang
6
- # --------------------------------------------------------
7
-
8
- from . import octree
9
- from . import nn
10
- from . import modules
11
- from . import models
12
- from . import dataset
13
- from . import utils
14
-
15
- __version__ = '2.2.8'
16
-
17
- __all__ = [
18
- 'octree',
19
- 'nn',
20
- 'modules',
21
- 'models',
22
- 'dataset',
23
- 'utils'
24
- ]
1
+ # --------------------------------------------------------
2
+ # Octree-based Sparse Convolutional Neural Networks
3
+ # Copyright (c) 2022 Peng-Shuai Wang <wangps@hotmail.com>
4
+ # Licensed under The MIT License [see LICENSE for details]
5
+ # Written by Peng-Shuai Wang
6
+ # --------------------------------------------------------
7
+
8
+ from . import octree
9
+ from . import nn
10
+ from . import modules
11
+ from . import models
12
+ from . import dataset
13
+ from . import utils
14
+
15
+ __version__ = '2.3.0'
16
+
17
+ __all__ = [
18
+ 'octree',
19
+ 'nn',
20
+ 'modules',
21
+ 'models',
22
+ 'dataset',
23
+ 'utils'
24
+ ]