class_docstr: PyTorch implementation for the inference.
  
  Args:
      path (str | Path): Path to Torch model weights.
      device (str): Device to use for inference. Options are auto, cpu, cuda. Defaults to "auto".
class_docstr_tok: ["PyTorch","implementation","for","the","inference",".","Args",":","path","(","str","|","Path",")",":","Path","to","Torch","model","weights",".","device","(","str",")",":","Device","to","use","for","inference",".","Options","are","auto",",","cpu",",","cuda",".","Defaults","to","``","auto","''","."]
docstr: Pre process the input image by applying transformations.
  
  Args:
      image (np.ndarray): Input image
  
  Returns:
      Tensor: pre-processed image.
docstr_tok: ["Pre","process","the","input","image","by","applying","transformations",".","Args",":","image","(","np.ndarray",")",":","Input","image","Returns",":","Tensor",":","pre-processed","image","."]
code: def pre_process(self, image: np.ndarray) -> Tensor:
      """Pre process the input image by applying transformations.
  
      Args:
          image (np.ndarray): Input image
  
      Returns:
          Tensor: pre-processed image.
      """
      processed_image = self.transform(image=image)["image"]
  
      if len(processed_image) == 3:
          processed_image = processed_image.unsqueeze(0)
  
      return processed_image.to(self.device)
  
imports: from __future__ import annotations
  from pathlib import Path
  from typing import Any, Sequence
  import albumentations
  import cv2
  import numpy
  import torch
  from omegaconf import DictConfig
  from torch import Tensor, nn
  from anomalib.data import TaskType
  from anomalib.data.utils.boxes import masks_to_boxes
  from .base_inferencer import Inferencer
label_desc: Use image node_id 6 for calling the TorchInferencer obj's underlying member method code with example usage: obj.pre_process(image) and returns: processed_image