class_docstr: TransRAC model
  
  Args:
      backbone (`str`):
          Model name of pretrained backbone.
      num_frames (`int`):
          Number of video frames.
      scales (`list`):
          A list of scale numbers.
  
  Example:
      >>> import torch
      >>> from towhee.models import video_swin_transformer
      >>> from towhee.models.transrac import TransRAC
      >>>
      >>> dummy_video = torch.rand(1, 3, 4, 200, 200) # (bcthw)
      >>>
      >>> backbone = video_swin_transformer.create_model() # use default configs here
      >>> model = TransRAC(backbone=backbone, num_frames=4)
      >>>
      >>> out, out_matrix = model(dummy_video)
      >>> print(out.shape, out_matrix.shape)
      torch.Size([1, 4]), torch.Size([1, 12, 4, 4])
code: def __init__(
      self, backbone: str, num_frames: int = 64, scales: list = None
  ):
      super().__init__()
      if scales is None:
          scales = [1, 4, 8]
      self.num_frames = num_frames
      # self.config = config
      self.scales = scales
  
      # Load pretrained Video Swin Transformer
      # self.backbone = create_model(model_name=backbone, pretrained=True)
      self.backbone = backbone
  
      self.replication_padding1 = nn.ConstantPad3d(
          (0, 0, 0, 0, 1, 1), 0
      )
      self.replication_padding2 = nn.ConstantPad3d(
          (0, 0, 0, 0, 2, 2), 0
      )
      self.replication_padding4 = nn.ConstantPad3d(
          (0, 0, 0, 0, 4, 4), 0
      )
  
      self.conv3d = nn.Conv3d(
          in_channels=768,
          out_channels=512,
          kernel_size=3,
          padding=(3, 1, 1),
          dilation=(3, 1, 1),
      )
  
      self.bn1 = nn.BatchNorm3d(512)
      self.spatial_pooling = nn.MaxPool3d(kernel_size=(1, 7, 7))
  
      self.sims = SimilarityMatrix()
      self.conv3x3 = nn.Conv2d(
          in_channels=4 * len(self.scales),  # num_head*scale_num
          out_channels=32,
          kernel_size=3,
          padding=1,
      )
  
      self.bn2 = nn.BatchNorm2d(32)
  
      self.dropout1 = nn.Dropout(0.25)
      self.input_projection = nn.Linear(self.num_frames * 32, 512)
      self.ln1 = nn.LayerNorm(512)
  
      self.trans_encoder = TransformerEncoder(
          d_model=512,
          n_head=4,
          dim_ff=512,
          num_layers=1,
          num_frames=self.num_frames,
          dropout=0.2,
      )
      self.fc = DenseMap(512, 512, 256, 1)
  
imports: import torch
  from torch import nn
  from towhee.models.layers.transformer_encoder import TransformerEncoder
  from towhee.models.transrac.utils import DenseMap, SimilarityMatrix
label_desc: Use image node_id 1 to create a new TransRAC object from inherited base classes: nn with example: obj = TransRAC(backbone, num_frames, scales)