class_docstr: CVNet
  
  Args:
      resnet_depth (`int`):
          ResNet depth.
      reduction_dim (`int`):
          Reduction dimension of ResNet.
code: def __init__(self, resnet_depth=50, reduction_dim=2048):
      super().__init__()
  
      self.encoder_q = ResNet(resnet_depth, reduction_dim)
      self.encoder_q.eval()
  
      self.scales = [0.25, 0.5, 1.0]
      self.num_scales = len(self.scales)
  
      feat_dim_l3 = 1024
      self.channel_compressed = 256
  
      self.softmax = nn.Softmax(dim=1)
      self.extract_feats = extract_feat_res_pycls
  
      if resnet_depth == 50:
          nbottlenecks = [3, 4, 6, 3]
          self.feat_ids = [13]
      elif resnet_depth == 101:
          nbottlenecks = [3, 4, 23, 3]
          self.feat_ids = [30]
      else:
          raise Exception("Unavailable RESNET_DEPTH %s" % resnet_depth)
  
      self.bottleneck_ids = reduce(
          add, list(map(lambda x: list(range(x)), nbottlenecks))
      )
      self.lids = reduce(
          add, [[i + 1] * x for i, x in enumerate(nbottlenecks)]
      )
  
      self.conv2ds = nn.ModuleList(
          [
              nn.Conv2d(
                  feat_dim_l3, 256, kernel_size=3, padding=1, bias=False
              )
              for _ in self.scales
          ]
      )
  
      self.cv_learner = CVLearner(
          [
              self.num_scales * self.num_scales,
              self.num_scales * self.num_scales,
              self.num_scales * self.num_scales,
          ]
      )
  
file_path: towhee/towhee/models/cvnet/cvnet.py
imports: from functools import reduce
  from operator import add
  import torch
  from torch import nn
  from towhee.models.cvnet.cvnet_utils import extract_feat_res_pycls, get_configs
  from towhee.models.cvnet.cvnet_block import CVLearner, Correlation
  from towhee.models.cvnet.resnet import ResNet
  from towhee.models.utils import create_model
label_desc: Use image node_id 1 to create a new CVNet object from inherited base classes: nn with example: obj = CVNet(resnet_depth, reduction_dim)