code: def __init__(self, name, pretrained=True, transforms=None) -> None:
      super().__init__()
  
      try:
          import torchvision
      except ModuleNotFoundError:
          log.warning("-" * 100)
          log.warning(
              'ATTENTION! The library "torchvision" is not installed!'
          )
          log.warning(
              'To use convnets pretraned on ImageNet, please first install with "pip install torchvision"'
          )
          log.warning("-" * 100)
  
      model_info = {
          "resnet50": (
              torchvision.models.resnet50,
              lambda x: list(x)[:-1],
              2048,
          ),
          "mobilenet_v2": (
              torchvision.models.mobilenet_v2,
              lambda x: list(x)[:-1]
              + [torch.nn.AdaptiveAvgPool2d((1, 1))],
              1280,
          ),
      }
  
      transforms = [] if transforms is None else transforms
      transforms += [torchvision.transforms.ToTensor()]
      if pretrained:
          imagenet_mean = [0.485, 0.456, 0.406]
          imagenet_std = [0.229, 0.224, 0.225]
          transforms += [
              torchvision.transforms.Normalize(
                  mean=imagenet_mean, std=imagenet_std
              )
          ]
      self.transforms = torchvision.transforms.Compose(transforms)
  
      if name in model_info:
          model_constructor = model_info[name][0]
          model_features = model_info[name][1]
          embedding_length = model_info[name][2]
  
          net = model_constructor(pretrained=pretrained)
          modules = model_features(net.children())
          self.features = torch.nn.Sequential(*modules)
  
          self.__embedding_length = embedding_length
  
          self.name = name
      else:
          raise Exception(f"Image embeddings {name} not available.")
  
imports: import logging
  from typing import Any, Dict, List, Optional
  import torch
  import torch.nn.functional
  from torch.nn import AdaptiveAvgPool2d, AdaptiveMaxPool2d, Conv2d, Dropout2d, Linear, MaxPool2d, Parameter, ReLU, Sequential, TransformerEncoder, TransformerEncoderLayer
  import flair
  from flair.data import Image
  from flair.embeddings.base import Embeddings, register_embeddings
label_desc: Use image node_id 1 to create a new NetworkImageEmbeddings object from inherited base classes: ImageEmbeddings with example: obj = NetworkImageEmbeddings(name, pretrained, transforms)