code: def __init__(self, model_path):
      super().__init__()
  
      self.netVggOne = torch.nn.Sequential(
          torch.nn.Conv2d(
              in_channels=3,
              out_channels=64,
              kernel_size=3,
              stride=1,
              padding=1,
          ),
          torch.nn.ReLU(inplace=False),
          torch.nn.Conv2d(
              in_channels=64,
              out_channels=64,
              kernel_size=3,
              stride=1,
              padding=1,
          ),
          torch.nn.ReLU(inplace=False),
      )
  
      self.netVggTwo = torch.nn.Sequential(
          torch.nn.MaxPool2d(kernel_size=2, stride=2),
          torch.nn.Conv2d(
              in_channels=64,
              out_channels=128,
              kernel_size=3,
              stride=1,
              padding=1,
          ),
          torch.nn.ReLU(inplace=False),
          torch.nn.Conv2d(
              in_channels=128,
              out_channels=128,
              kernel_size=3,
              stride=1,
              padding=1,
          ),
          torch.nn.ReLU(inplace=False),
      )
  
      self.netVggThr = torch.nn.Sequential(
          torch.nn.MaxPool2d(kernel_size=2, stride=2),
          torch.nn.Conv2d(
              in_channels=128,
              out_channels=256,
              kernel_size=3,
              stride=1,
              padding=1,
          ),
          torch.nn.ReLU(inplace=False),
          torch.nn.Conv2d(
              in_channels=256,
              out_channels=256,
              kernel_size=3,
              stride=1,
              padding=1,
          ),
          torch.nn.ReLU(inplace=False),
          torch.nn.Conv2d(
              in_channels=256,
              out_channels=256,
              kernel_size=3,
              stride=1,
              padding=1,
          ),
          torch.nn.ReLU(inplace=False),
      )
  
      self.netVggFou = torch.nn.Sequential(
          torch.nn.MaxPool2d(kernel_size=2, stride=2),
          torch.nn.Conv2d(
              in_channels=256,
              out_channels=512,
              kernel_size=3,
              stride=1,
              padding=1,
          ),
          torch.nn.ReLU(inplace=False),
          torch.nn.Conv2d(
              in_channels=512,
              out_channels=512,
              kernel_size=3,
              stride=1,
              padding=1,
          ),
          torch.nn.ReLU(inplace=False),
          torch.nn.Conv2d(
              in_channels=512,
              out_channels=512,
              kernel_size=3,
              stride=1,
              padding=1,
          ),
          torch.nn.ReLU(inplace=False),
      )
  
      self.netVggFiv = torch.nn.Sequential(
          torch.nn.MaxPool2d(kernel_size=2, stride=2),
          torch.nn.Conv2d(
              in_channels=512,
              out_channels=512,
              kernel_size=3,
              stride=1,
              padding=1,
          ),
          torch.nn.ReLU(inplace=False),
          torch.nn.Conv2d(
              in_channels=512,
              out_channels=512,
              kernel_size=3,
              stride=1,
              padding=1,
          ),
          torch.nn.ReLU(inplace=False),
          torch.nn.Conv2d(
              in_channels=512,
              out_channels=512,
              kernel_size=3,
              stride=1,
              padding=1,
          ),
          torch.nn.ReLU(inplace=False),
      )
  
      self.netScoreOne = torch.nn.Conv2d(
          in_channels=64,
          out_channels=1,
          kernel_size=1,
          stride=1,
          padding=0,
      )
      self.netScoreTwo = torch.nn.Conv2d(
          in_channels=128,
          out_channels=1,
          kernel_size=1,
          stride=1,
          padding=0,
      )
      self.netScoreThr = torch.nn.Conv2d(
          in_channels=256,
          out_channels=1,
          kernel_size=1,
          stride=1,
          padding=0,
      )
      self.netScoreFou = torch.nn.Conv2d(
          in_channels=512,
          out_channels=1,
          kernel_size=1,
          stride=1,
          padding=0,
      )
      self.netScoreFiv = torch.nn.Conv2d(
          in_channels=512,
          out_channels=1,
          kernel_size=1,
          stride=1,
          padding=0,
      )
  
      self.netCombine = torch.nn.Sequential(
          torch.nn.Conv2d(
              in_channels=5,
              out_channels=1,
              kernel_size=1,
              stride=1,
              padding=0,
          ),
          torch.nn.Sigmoid(),
      )
  
      self.load_state_dict(
          {
              strKey.replace("module", "net"): tenWeight
              for strKey, tenWeight in torch.load(model_path).items()
          }
      )
  
file_path: lavis/lavis/common/annotator/hed/__init__.py
imports: import numpy
  import cv2
  import os
  import torch
  from einops import rearrange
  from annotator.util import annotator_ckpts_path
label_desc: Use image node_id 1 to create a new Network object from inherited base classes: torch.nn with example: obj = Network(model_path)