class_docstr: Component to perform the perceptual evaluation with the networks pretrained on RadImagenet (pretrained by Mei, et
  al. "RadImageNet: An Open Radiologic Deep Learning Research Dataset for Effective Transfer Learning"). This class
  uses torch Hub to download the networks from "Warvito/radimagenet-models".
  
  Args:
      net: {``"radimagenet_resnet50"``}
          Specifies the network architecture to use. Defaults to ``"radimagenet_resnet50"``.
      verbose: if false, mute messages from torch Hub load function.
docstr: We expect that the input is normalised between [0, 1]. Given the preprocessing performed during the training at
  https://github.com/BMEII-AI/RadImageNet, we make sure that the input and target have 3 channels, reorder it from
   'RGB' to 'BGR', and then remove the mean components of each input data channel. The outputs are normalised
  across the channels, and we obtain the mean from the spatial dimensions (similar approach to the lpips package).
docstr_tok: ["We","expect","that","the","input","is","normalised","between","[","0",",","1","]",".","Given","the","preprocessing","performed","during","the","training","at","https",":","\/\/github.com\/BMEII-AI\/RadImageNet",",","we","make","sure","that","the","input","and","target","have","3","channels",",","reorder","it","from","'RGB","'","to","'BGR","'",",","and","then","remove","the","mean","components","of","each","input","data","channel",".","The","outputs","are","normalised","across","the","channels",",","and","we","obtain","the","mean","from","the","spatial","dimensions","(","similar","approach","to","the","lpips","package",")","."]
code: def forward(
      self, input: torch.Tensor, target: torch.Tensor
  ) -> torch.Tensor:
      """
      We expect that the input is normalised between [0, 1]. Given the preprocessing performed during the training at
      https://github.com/BMEII-AI/RadImageNet, we make sure that the input and target have 3 channels, reorder it from
       'RGB' to 'BGR', and then remove the mean components of each input data channel. The outputs are normalised
      across the channels, and we obtain the mean from the spatial dimensions (similar approach to the lpips package).
      """
      # If input has just 1 channel, repeat channel to have 3 channels
      if input.shape[1] == 1 and target.shape[1] == 1:
          input = input.repeat(1, 3, 1, 1)
          target = target.repeat(1, 3, 1, 1)
  
      # Change order from 'RGB' to 'BGR'
      input = input[:, [2, 1, 0], ...]
      target = target[:, [2, 1, 0], ...]
  
      # Subtract mean used during training
      input = subtract_mean(input)
      target = subtract_mean(target)
  
      # Get model outputs
      outs_input = self.model.forward(input)
      outs_target = self.model.forward(target)
  
      # Normalise through the channels
      feats_input = normalize_tensor(outs_input)
      feats_target = normalize_tensor(outs_target)
  
      results: torch.Tensor = (feats_input - feats_target) ** 2
      results = spatial_average(
          results.sum(dim=1, keepdim=True), keepdim=True
      )
  
      return results
  
imports: from __future__ import annotations
  import warnings
  import torch
  import torch.nn
  from monai.utils import optional_import
  from monai.utils.enums import StrEnum
label_desc: Use image node_id 2 for calling the RadImageNetPerceptualSimilarity obj's underlying member method code with example usage: obj.forward(input, target) and returns: results