code: def __init__(self, pretrained=True, freeze=True):
      super(vgg16_bn, self).__init__()
      if version.parse(torchvision.__version__) >= version.parse(
          "0.13"
      ):
          vgg_pretrained_features = models.vgg16_bn(
              weights=models.VGG16_BN_Weights.DEFAULT
              if pretrained
              else None
          ).features
      else:  # torchvision.__version__ < 0.13
          models.vgg.model_urls["vgg16_bn"] = models.vgg.model_urls[
              "vgg16_bn"
          ].replace("https://", "http://")
          vgg_pretrained_features = models.vgg16_bn(
              pretrained=pretrained
          ).features
  
      self.slice1 = torch.nn.Sequential()
      self.slice2 = torch.nn.Sequential()
      self.slice3 = torch.nn.Sequential()
      self.slice4 = torch.nn.Sequential()
      self.slice5 = torch.nn.Sequential()
      for x in range(12):  # conv2_2
          self.slice1.add_module(str(x), vgg_pretrained_features[x])
      for x in range(12, 19):  # conv3_3
          self.slice2.add_module(str(x), vgg_pretrained_features[x])
      for x in range(19, 29):  # conv4_3
          self.slice3.add_module(str(x), vgg_pretrained_features[x])
      for x in range(29, 39):  # conv5_3
          self.slice4.add_module(str(x), vgg_pretrained_features[x])
  
      # fc6, fc7 without atrous conv
      self.slice5 = torch.nn.Sequential(
          nn.MaxPool2d(kernel_size=3, stride=1, padding=1),
          nn.Conv2d(512, 1024, kernel_size=3, padding=6, dilation=6),
          nn.Conv2d(1024, 1024, kernel_size=1),
      )
  
      if not pretrained:
          init_weights(self.slice1.modules())
          init_weights(self.slice2.modules())
          init_weights(self.slice3.modules())
          init_weights(self.slice4.modules())
  
      init_weights(
          self.slice5.modules()
      )  # no pretrained model for fc6 and fc7
  
      if freeze:
          for param in self.slice1.parameters():  # only first conv
              param.requires_grad = False
  
file_path: EasyOCR/trainer/craft/model/vgg16_bn.py
imports: import torch
  import torch.nn
  import torch.nn.init
  import torchvision
  from torchvision import models
  from packaging import version
label_desc: Use image node_id 1 to create a new vgg16_bn object from inherited base classes: torch.nn with example: obj = vgg16_bn(pretrained, freeze)