:py:mod:`anomalib.models.stfpm.torch_model` =========================================== .. py:module:: anomalib.models.stfpm.torch_model .. autoapi-nested-parse:: PyTorch model for the STFPM model implementation. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: anomalib.models.stfpm.torch_model.STFPMModel .. py:class:: STFPMModel(layers: List[str], input_size: Tuple[int, int], backbone: str = 'resnet18') Bases: :py:obj:`torch.nn.Module` STFPM: Student-Teacher Feature Pyramid Matching for Unsupervised Anomaly Detection. :param layers: Layers used for feature extraction :type layers: List[str] :param input_size: Input size for the model. :type input_size: Tuple[int, int] :param backbone: Pre-trained model backbone. Defaults to "resnet18". :type backbone: str, optional .. py:method:: forward(images) Forward-pass images into the network. During the training mode the model extracts the features from the teacher and student networks. During the evaluation mode, it returns the predicted anomaly map. :param images: Batch of images. :type images: Tensor :returns: Teacher and student features when in training mode, otherwise the predicted anomaly maps.