class_docstr: EG1800 dataset `http://xiaoyongshen.me/webpage_portrait/index.html`.
  
  Args:
      common_transforms (list): A list of common image transformations for two inputs of portrait net.
      transforms1 (list): A list of image transformations for the first input of portrait net.
      transforms2 (list): A list of image transformations for the second input of portrait net.
      dataset_root (str, optional): The EG1800 dataset directory. Default: None.
      mode (str, optional): A subset of the entire dataset. It should be one of ('train', 'val'). Default: 'train'.
      edge (bool, optional): Whether to compute edge while training. Default: False
code: def __getitem__(self, item):
      image_path, label_path = self.file_list[item]
      im = cv2.imread(image_path)
      label = cv2.imread(label_path, 0)
      label[label > 1] = 0
  
      if self.mode == "val":
          common_data = self.common_transforms(
              dict(img=im, label=label)
          )
          common_im, label = common_data["img"], common_data["label"]
          im = np.float32(common_im[::-1, :, :])  # RGB => BGR
          im_aug = copy.deepcopy(im)
      else:
          common_data = self.common_transforms(
              dict(img=im, label=label)
          )
          common_im, label = common_data["img"], common_data["label"]
          common_im = np.transpose(common_im, [1, 2, 0])
          # add augmentation
          data = self.transforms1(dict(img=common_im))
          im = data["img"]
          data = self.transforms2(dict(img=common_im))
          im_aug = data["img"]
          im = np.float32(im[::-1, :, :])  # RGB => BGR
          im_aug = np.float32(im_aug[::-1, :, :])  # RGB => BGR
  
      label = cv2.resize(
          np.uint8(label),
          (self.input_width, self.input_height),
          interpolation=cv2.INTER_NEAREST,
      )
  
      # add mask blur
      label = np.uint8(cv2.blur(label, (5, 5)))
      label[label >= 0.5] = 1
      label[label < 0.5] = 0
  
      edge_mask = F.mask_to_binary_edge(
          label, radius=4, num_classes=self.num_classes
      )
      edge_mask = np.transpose(edge_mask, [1, 2, 0]).squeeze(axis=-1)
      # im = np.concatenate([im_aug, im])
      # im = im_aug
      if self.mode == "train":
          return dict(img=im, label=label, edge=edge_mask)
      else:
          return dict(img=im, label=label)
  
file_path: PaddleSeg/paddleseg/datasets/eg1800.py
imports: import os
  import copy
  import cv2
  import numpy
  from paddleseg.datasets import Dataset
  from paddleseg.cvlibs import manager
  from paddleseg.transforms import Compose
  from paddleseg.utils.download import download_file_and_uncompress
  from paddleseg.utils import seg_env
  import paddleseg.transforms.functional
label_desc: Use image node_id 2 for calling the EG1800 obj's underlying member method code with example usage: obj.__getitem__(item) and returns: dict, dict