ocnn.modules

InputFeature

Returns the initial input feature stored in octree.

OctreeConvBn

A sequence of OctreeConv and BatchNorm.

OctreeConvBnRelu

A sequence of OctreeConv, BatchNorm, and Relu.

OctreeDeconvBnRelu

A sequence of OctreeDeconv, BatchNorm, and Relu.

Conv1x1

Performs a convolution with kernel (1,1,1).

Conv1x1Bn

A sequence of Conv1x1 and BatchNorm.

Conv1x1BnRelu

A sequence of Conv1x1, BatchNorm and Relu.

FcBnRelu

A sequence of FC, BatchNorm and Relu.

OctreeConvGn

A sequence of OctreeConv and OctreeGroupNorm.

OctreeConvGnRelu

A sequence of OctreeConv, OctreeGroupNorm, and Relu.

OctreeDeconvGnRelu

A sequence of OctreeDeconv, OctreeGroupNorm, and Relu.

Conv1x1

Performs a convolution with kernel (1,1,1).

Conv1x1Gn

A sequence of Conv1x1, OctreeGroupNorm.

Conv1x1GnRelu

A sequence of Conv1x1, OctreeGroupNorm and Relu.

OctreeResBlock

Octree-based ResNet block in a bottleneck style.

OctreeResBlock2

Basic Octree-based ResNet block.

OctreeResBlockGn

OctreeResBlocks

A sequence of resblk_num ResNet blocks.

class InputFeature(feature: str = 'NDF', nempty: bool = False)[source]

Returns the initial input feature stored in octree.

Refer to ocnn.octree.Octree.get_input_feature() for details.

forward(octree: Octree)[source]
class OctreeConvBn(in_channels: int, out_channels: int, kernel_size: List[int] = [3], stride: int = 1, nempty: bool = False)[source]

A sequence of OctreeConv and BatchNorm.

Please refer to ocnn.nn.OctreeConv for details on the parameters.

forward(data: Tensor, octree: Octree, depth: int)[source]
class OctreeConvBnRelu(in_channels: int, out_channels: int, kernel_size: List[int] = [3], stride: int = 1, nempty: bool = False)[source]

A sequence of OctreeConv, BatchNorm, and Relu.

Please refer to ocnn.nn.OctreeConv for details on the parameters.

forward(data: Tensor, octree: Octree, depth: int)[source]
class OctreeDeconvBnRelu(in_channels: int, out_channels: int, kernel_size: List[int] = [3], stride: int = 1, nempty: bool = False)[source]

A sequence of OctreeDeconv, BatchNorm, and Relu.

Please refer to ocnn.nn.OctreeDeconv for details on the parameters.

forward(data: Tensor, octree: Octree, depth: int)[source]
class Conv1x1(in_channels: int, out_channels: int, use_bias: bool = False)[source]

Performs a convolution with kernel (1,1,1).

The shape of octree features is (N, C), where N is the node number and C is the feature channel. Therefore, Conv1x1 can be implemented with torch.nn.Linear.

forward(data: Tensor)[source]
class Conv1x1Bn(in_channels: int, out_channels: int)[source]

A sequence of Conv1x1 and BatchNorm.

forward(data: Tensor)[source]
class Conv1x1BnRelu(in_channels: int, out_channels: int)[source]

A sequence of Conv1x1, BatchNorm and Relu.

forward(data: Tensor)[source]
class FcBnRelu(in_channels: int, out_channels: int)[source]

A sequence of FC, BatchNorm and Relu.

forward(data)[source]
class OctreeConvGn(in_channels: int, out_channels: int, group: int, kernel_size: List[int] = [3], stride: int = 1, nempty: bool = False)[source]

A sequence of OctreeConv and OctreeGroupNorm.

Please refer to ocnn.nn.OctreeConv for details on the parameters.

forward(data: Tensor, octree: Octree, depth: int)[source]
class OctreeConvGnRelu(in_channels: int, out_channels: int, group: int, kernel_size: List[int] = [3], stride: int = 1, nempty: bool = False)[source]

A sequence of OctreeConv, OctreeGroupNorm, and Relu.

Please refer to ocnn.nn.OctreeConv for details on the parameters.

forward(data: Tensor, octree: Octree, depth: int)[source]
class OctreeDeconvGnRelu(in_channels: int, out_channels: int, group: int, kernel_size: List[int] = [3], stride: int = 1, nempty: bool = False)[source]

A sequence of OctreeDeconv, OctreeGroupNorm, and Relu.

Please refer to ocnn.nn.OctreeConv for details on the parameters.

forward(data: Tensor, octree: Octree, depth: int)[source]
class Conv1x1Gn(in_channels: int, out_channels: int, group: int, nempty: bool = False)[source]

A sequence of Conv1x1, OctreeGroupNorm.

forward(data: Tensor, octree: Octree, depth: int)[source]
class Conv1x1GnRelu(in_channels: int, out_channels: int, group: int, nempty: bool = False)[source]

A sequence of Conv1x1, OctreeGroupNorm and Relu.

forward(data: Tensor, octree: Octree, depth: int)[source]
class OctreeResBlock(in_channels: int, out_channels: int, stride: int = 1, bottleneck: int = 4, nempty: bool = False)[source]

Octree-based ResNet block in a bottleneck style. The block is composed of a series of Conv1x1, Conv3x3, and Conv1x1.

Parameters:
  • in_channels (int) – Number of input channels.

  • out_channels (int) – Number of output channels.

  • stride (int) – The stride of the block (1 or 2).

  • bottleneck (int) – The input and output channels of the Conv3x3 is equal to the input channel divided by bottleneck.

  • nempty (bool) – If True, only performs the convolution on non-empty octree nodes.

forward(data: Tensor, octree: Octree, depth: int)[source]
class OctreeResBlock2(in_channels, out_channels, stride=1, bottleneck=1, nempty=False)[source]

Basic Octree-based ResNet block. The block is composed of a series of Conv3x3 and Conv3x3.

Refer to OctreeResBlock for the details of arguments.

forward(data: Tensor, octree: Octree, depth: int)[source]
class OctreeResBlockGn(in_channels: int, out_channels: int, stride: int = 1, bottleneck: int = 4, nempty: bool = False, group: int = 32)[source]
forward(data: Tensor, octree: Octree, depth: int)[source]
class OctreeResBlocks(in_channels, out_channels, resblk_num, bottleneck=4, nempty=False, resblk=<class 'ocnn.modules.resblocks.OctreeResBlock'>, use_checkpoint=False)[source]

A sequence of resblk_num ResNet blocks.

forward(data: Tensor, octree: Octree, depth: int)[source]