code: def __getitem__(self, index):
      subject_id = self.df["subject_id"][index]
      facial_action = self.df["facial_action"][index]
      img_id = self.df["img_id"][index]
  
      img_path = (
          self.data_root
          / "image"
          / subject_id
          / facial_action
          / f"{img_id}_ar.jpg"
      )
      npz_path = (
          self.data_root
          / "info"
          / subject_id
          / facial_action
          / f"{img_id}_info.npz"
      )
      txt_path = (
          self.data_root
          / "68landmarks"
          / subject_id
          / facial_action
          / f"{img_id}_68landmarks.txt"
      )
      # if not osp.exists(img_path):
      #    continue
  
      # print(img_path)
      img_raw = cv2.imread(str(img_path))
      # if img_raw is None:
      #    print('XXX ERR:', img_path)
      img_raw = cv2.cvtColor(img_raw, cv2.COLOR_BGR2RGB)
      # print(img_raw.shape)
      img_h, img_w, _ = img_raw.shape
      pts68 = np.loadtxt(txt_path, dtype=np.int32)
  
      x_min, y_min = pts68.min(axis=0)
      x_max, y_max = pts68.max(axis=0)
      x_center = (x_min + x_max) / 2
      y_center = (y_min + y_max) / 2
      w, h = x_max - x_min, y_max - y_min
  
      if not self.align_face:
          size = max(w, h)
          ss = np.array(
              [0.75, 0.75, 0.85, 0.65]
          )  # predefined expand size
  
          left = x_center - ss[0] * size
          right = x_center + ss[1] * size
          top = y_center - ss[2] * size
          bottom = y_center + ss[3] * size
  
          src_pts = np.float32(
              [[left, top], [left, bottom], [right, top]]
          )
          tform = cv2.getAffineTransform(src_pts, self.dst_pts)
      else:
          src_pts = np.float32(
              [
                  (pts68[36] + pts68[39]) / 2,
                  (pts68[42] + pts68[45]) / 2,
                  pts68[30],
                  pts68[48],
                  pts68[54],
              ]
          )
          tf = sktrans.SimilarityTransform()
          tf.estimate(src_pts, self.dst_pts)
          tform = tf.params[0:2, :]
  
      img_local = cv2.warpAffine(
          img_raw, tform, (self.input_size,) * 2, flags=cv2.INTER_CUBIC
      )
      fake_points2d = np.ones((1, 2), dtype=np.float32) * (
          self.input_size // 2
      )
  
      # tform_inv = cv2.invertAffineTransform(tform)
      # img_global = cv2.warpAffine(img_local, tform_inv, (img_w, img_h), borderValue=0.0)
      # img_global = cv2.resize(img_global, (self.input_size, self.input_size))
      if self.transform is not None:
          t = self.transform(image=img_local, keypoints=fake_points2d)
          img_local = t["image"]
          if self.is_test_aug:
              height, width = img_local.shape[:2]
              for trans in t["replay"]["transforms"]:
                  if (
                      trans["__class_fullname__"] == "ShiftScaleRotate"
                      and trans["applied"]
                  ):
                      param = trans["params"]
                      dx, dy, angle, scale = (
                          param["dx"],
                          param["dy"],
                          param["angle"],
                          param["scale"],
                      )
                      center = (width / 2, height / 2)
                      matrix = cv2.getRotationMatrix2D(
                          center, angle, scale
                      )
                      matrix[0, 2] += dx * width
                      matrix[1, 2] += dy * height
                      new_matrix = np.identity(3)
                      new_matrix[:2, :3] = matrix
                      old_tform = np.identity(3)
                      old_tform[:2, :3] = tform
                      # new_tform = np.dot(old_tform, new_matrix)
                      new_tform = np.dot(new_matrix, old_tform)
                      # print('label_tform:')
                      # print(label_tform.flatten())
                      # print(new_matrix.flatten())
                      # print(new_tform.flatten())
                      tform = new_tform[:2, :3]
                      break
                      # print('trans param:', param)
          # img_global = self.transform(image=img_global)['image']
  
      tform_tensor = torch.tensor(tform, dtype=torch.float32)
      d = {"img_local": img_local, "tform": tform_tensor}
      if self.eye_dataset is not None:
          eye_key = str(
              Path("image")
              / subject_id
              / facial_action
              / f"{img_id}_ar.jpg"
          )
          # print(eye_key)
          eyel, eyer = self.eye_dataset.get(eye_key, to_homo=True)
          if eyel is not None:
              # print(eye_key, el_inv.shape, er_inv.shape)
              d["eye_world_left"] = torch.tensor(
                  eyel, dtype=torch.float32
              )
              d["eye_world_right"] = torch.tensor(
                  eyer, dtype=torch.float32
              )
      if not self.is_test:
          M = np.load(npz_path)
          # yaw_gt, pitch_gt, roll_gt = Rotation.from_matrix(M['R_t'][:3, :3].T).as_euler('yxz', degrees=False)
          # label_euler = np.array([pitch_gt, yaw_gt, roll_gt])
          # label_translation = M['R_t'][3, :3]
          # label_6dof = np.concatenate([label_euler, label_translation])
          # label_6dof = (label_6dof - self.label_6dof_mean) / self.label_6dof_std
          # label_6dof_tensor = torch.tensor(label_6dof, dtype=torch.float32)
          # label_verts = M['verts'] * 10.0     # roughly [-1, 1]
          # label_verts_tensor = torch.tensor(label_verts, dtype=torch.float32)
          # return img_local, label_verts_tensor, label_6dof_tensor
          label_verts_tensor = torch.tensor(
              M["verts"], dtype=torch.float32
          )
          label_Rt_tensor = torch.tensor(M["R_t"], dtype=torch.float32)
          d["verts"] = label_verts_tensor
          d["rt"] = label_Rt_tensor
          # return img_local, img_global, label_verts_tensor, label_Rt_tensor, tform_tensor
          # return img_local, label_verts_tensor, label_Rt_tensor, tform_tensor
      else:
          # return img_local, img_global, tform_tensor
          index_tensor = torch.tensor(index, dtype=torch.long)
          d["index"] = index_tensor
          # return img_local, tform_tensor, index_tensor
      return d
  
imports: import numbers
  import os
  import os.path
  import pickle
  import queue
  import threading
  import logging
  import numbers
  import math
  import pandas
  from scipy.spatial.transform import Rotation
  import mxnet
  from pathlib import Path
  import numpy
  import torch
  from torch.utils.data import DataLoader, Dataset
  from skimage import transform
  import cv2
  import albumentations
  from albumentations.pytorch import ToTensorV2
  from augs import *
label_desc: Use image node_id 4 for calling the FaceDataset obj's underlying member method code with example usage: obj.__getitem__(index) and returns: d