code: def predict(self, img_aligned: np.ndarray) -> np.ndarray:
      # functions.detectFace returns 4 dimensional images
      if len(img_aligned.shape) == 4:
          img_aligned = img_aligned[0]
  
      # functions.detectFace returns bgr images
      img_aligned = img_aligned[:, :, ::-1]  # bgr to rgb
  
      # deepface.detectFace returns an array in scale of [0, 1]
      # but dlib expects in scale of [0, 255]
      if img_aligned.max() <= 1:
          img_aligned = img_aligned * 255
  
      img_aligned = img_aligned.astype(np.uint8)
  
      model = self.__model
  
      img_representation = model.compute_face_descriptor(img_aligned)
  
      img_representation = np.array(img_representation)
      img_representation = np.expand_dims(img_representation, axis=0)
  
      return img_representation
  
file_path: deepface/deepface/basemodels/DlibResNet.py
imports: import os
  import bz2
  import gdown
  import numpy
  from deepface.commons import functions
  from deepface.commons.logger import Logger
label_desc: Use image node_id 2 for calling the DlibResNet obj's underlying member method code with example usage: obj.predict(img_aligned) and returns: img_representation