class packnet_sfm.networks.layers.resnet.resnet_encoder.ResNetMultiImageInput(block, layers, num_classes=1000, num_input_images=1)[source]

Bases: torchvision.models.resnet.ResNet

Constructs a resnet model with varying number of input images. Adapted from

class packnet_sfm.networks.layers.resnet.resnet_encoder.ResnetEncoder(num_layers, pretrained, num_input_images=1)[source]

Bases: torch.nn.modules.module.Module

Pytorch module for a resnet encoder


Defines the computation performed at every call.

Should be overridden by all subclasses.


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.

packnet_sfm.networks.layers.resnet.resnet_encoder.resnet_multiimage_input(num_layers, pretrained=False, num_input_images=1)[source]

Constructs a ResNet model. :param num_layers: Number of resnet layers. Must be 18 or 50 :type num_layers: int :param pretrained: If True, returns a model pre-trained on ImageNet :type pretrained: bool :param num_input_images: Number of frames stacked as input :type num_input_images: int