code: def __init__(
      self,
      landmarks_type,
      network_size=NetworkSize.LARGE,
      device="cuda",
      dtype=torch.float32,
      flip_input=False,
      face_detector="sfd",
      face_detector_kwargs=None,
      verbose=False,
  ):
      self.device = device
      self.flip_input = flip_input
      self.landmarks_type = landmarks_type
      self.verbose = verbose
      self.dtype = dtype
  
      if version.parse(torch.__version__) < version.parse("1.5.0"):
          raise ImportError(
              f"Unsupported pytorch version detected. Minimum supported version of pytorch: 1.5.0\
                              Either upgrade (recommended) your pytorch setup, or downgrade to face-alignment 1.2.0"
          )
  
      network_size = int(network_size)
      pytorch_version = torch.__version__
      if "dev" in pytorch_version:
          pytorch_version = pytorch_version.rsplit(".", 2)[0]
      else:
          pytorch_version = pytorch_version.rsplit(".", 1)[0]
  
      if "cuda" in device:
          torch.backends.cudnn.benchmark = True
  
      # Get the face detector
      face_detector_module = __import__(
          "face_alignment.detection." + face_detector,
          globals(),
          locals(),
          [face_detector],
          0,
      )
      face_detector_kwargs = face_detector_kwargs or {}
      self.face_detector = face_detector_module.FaceDetector(
          device=device, verbose=verbose, **face_detector_kwargs
      )
  
      # Initialise the face alignemnt networks
      if landmarks_type == LandmarksType.TWO_D:
          network_name = "2DFAN-" + str(network_size)
      else:
          network_name = "3DFAN-" + str(network_size)
      self.face_alignment_net = torch.jit.load(
          load_file_from_url(
              models_urls.get(pytorch_version, default_model_urls)[
                  network_name
              ]
          )
      )
  
      self.face_alignment_net.to(device, dtype=dtype)
      self.face_alignment_net.eval()
  
      # Initialiase the depth prediciton network
      if landmarks_type == LandmarksType.THREE_D:
          self.depth_prediciton_net = torch.jit.load(
              load_file_from_url(
                  models_urls.get(pytorch_version, default_model_urls)[
                      "depth"
                  ]
              )
          )
  
          self.depth_prediciton_net.to(device, dtype=dtype)
          self.depth_prediciton_net.eval()
  
file_path: face-alignment/face_alignment/api.py
imports: import torch
  import warnings
  from enum import IntEnum
  from skimage import io
  import numpy
  from packaging import version
  from tqdm import tqdm
  from .utils import *
  from .folder_data import FolderData
label_desc: Use image node_id 1 to create a new FaceAlignment object  with example: obj = FaceAlignment(landmarks_type, network_size, device, dtype, flip_input, face_detector, face_detector_kwargs, verbose)