opr.modules.feature_extractors package

Feature extraction modules.

opr.modules.feature_extractors.convnext

ConvNeXt-based image feature extractors.

class opr.modules.feature_extractors.convnext.ConvNeXtTinyFeatureExtractor(in_channels: int = 3, pretrained: bool = True)[source]

Bases: Module

ConvNeXt-Tiny image feature extractor.

forward(image: Tensor) Tensor[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

opr.modules.feature_extractors.mink_resnet

ResNetFPN feature extraction module implemented with MinkowskiEngine.

Komorowski, Jacek. “Minkloc3d: Point cloud based large-scale place recognition.” Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision. 2021.

Paper: https://arxiv.org/abs/2011.04530 Code is adopted from the original repository: https://github.com/jac99/MinkLoc3Dv2, MIT License

class opr.modules.feature_extractors.mink_resnet.MinkResNetBase(in_channels: int, out_channels: int, dimension: int = 3)[source]

Bases: Module

Base ResNet class for sparse tensors with MinkowskiEngine.

block: Type[BasicBlock] | Type[Bottleneck] | Type[ECABasicBlock]
forward(x: MinkowskiEngine.SparseTensor) Tensor[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

init_dim: int = 64
layers: Tuple[int, ...] = (1, 1, 1, 1)
planes: Tuple[int, ...] = (64, 128, 256, 512)
sparse: bool = True
class opr.modules.feature_extractors.mink_resnet.MinkResNetFPNFeatureExtractor(in_channels: int = 1, out_channels: int = 256, num_top_down: int = 2, conv0_kernel_size: int = 5, block: str = 'ECABasicBlock', layers: Tuple[int, ...] = (1, 1, 1, 1), planes: Tuple[int, ...] = (64, 128, 64, 32))[source]

Bases: MinkResNetBase

Feature Pyramid Network (FPN) architecture implementation using Minkowski ResNet building blocks.

forward(x: MinkowskiEngine.SparseTensor) MinkowskiEngine.SparseTensor[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

sparse: bool = True

opr.modules.feature_extractors.resnet

ResNet-based image feature extractors.

class opr.modules.feature_extractors.resnet.ResNet18FPNFeatureExtractor(in_channels: int = 3, lateral_dim: int = 256, fh_num_bottom_up: int = 4, fh_num_top_down: int = 0, pretrained: bool = True)[source]

Bases: ResNetFPNFeatureExtractor

ResNet18 image feature extractor with FPN block.

The code is adopted from the repository: https://github.com/jac99/MinkLocMultimodal, MIT License

class opr.modules.feature_extractors.resnet.ResNet18FeatureExtractor(in_channels: int = 3, pretrained: bool = True)[source]

Bases: ResNetFeatureExtractor

ResNet18 image feature extractor.

class opr.modules.feature_extractors.resnet.ResNet50FPNFeatureExtractor(in_channels: int = 3, lateral_dim: int = 256, fh_num_bottom_up: int = 4, fh_num_top_down: int = 0, pretrained: bool = True)[source]

Bases: ResNetFPNFeatureExtractor

ResNet50 image feature extractor with FPN block.

The code is adopted from the repository: https://github.com/jac99/MinkLocMultimodal, MIT License

class opr.modules.feature_extractors.resnet.ResNet50FeatureExtractor(in_channels: int = 3, pretrained: bool = True)[source]

Bases: ResNetFeatureExtractor

ResNet50 image feature extractor.

class opr.modules.feature_extractors.resnet.ResNetFPNFeatureExtractor(model: Module, layers: tuple[int, int, int, int, int], in_channels: int = 3, lateral_dim: int = 256, fh_num_bottom_up: int = 4, fh_num_top_down: int = 0, pretrained: bool = True)[source]

Bases: Module

ResNet-based image feature extractor with FPN block.

The code is adopted from the repository: https://github.com/jac99/MinkLocMultimodal, MIT License

forward(image: Tensor) Tensor[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class opr.modules.feature_extractors.resnet.ResNetFeatureExtractor(model: Module, in_channels: int = 3, pretrained: bool = True)[source]

Bases: Module

ResNet-based image feature extractor.

forward(image: Tensor) Tensor[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

opr.modules.feature_extractors.svtnet

Implementation of feature extraction model from SVT-Net.

Citation:

Fan, Zhaoxin, et al. “Svt-net: Super light-weight sparse voxel transformer for large scale place recognition.” Proceedings of the AAAI Conference on Artificial Intelligence. Vol. 36. No. 1. 2022.

Source: https://github.com/ZhenboSong/SVTNet Paper: https://arxiv.org/abs/2105.00149

class opr.modules.feature_extractors.svtnet.SVTNetFeatureExtractor(in_channels: int = 1, out_channels: int = 256, conv0_kernel_size: int = 5, block: str = 'ECABasicBlock', asvt: bool = True, csvt: bool = True, layers: tuple[int, ...] = (1, 1, 1), planes: tuple[int, ...] = (32, 64, 64))[source]

Bases: MinkResNetBase

Feature extraction model from SVT-Net.

Source: https://github.com/ZhenboSong/SVTNet

forward(x: MinkowskiEngine.SparseTensor) MinkowskiEngine.SparseTensor[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

sparse: bool = True

opr.modules.feature_extractors.vgg

VGG-based image feature extractors.

class opr.modules.feature_extractors.vgg.VGG16FeatureExtractor(in_channels: int = 3, pretrained: bool = True)[source]

Bases: VGGFeatureExtractor

VGG-based image feature extractor.

class opr.modules.feature_extractors.vgg.VGGFeatureExtractor(model: Module, in_channels: int = 3, pretrained: bool = True)[source]

Bases: Module

VGG-based image feature extractor.

forward(image: Tensor) Tensor[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.