code: def _val_sync_transform(self, img, mask):
      if self.random_crop:
          crop_w, crop_h = self.crop_size
          w, h = img.size
          if crop_w / w < crop_h / h:
              oh = crop_h
              ow = int(1.0 * w * oh / h)
          else:
              ow = crop_w
              oh = int(1.0 * h * ow / w)
          img = img.resize((ow, oh), Image.BICUBIC)
          mask = mask.resize((ow, oh), Image.NEAREST)
          # center crop
          w, h = img.size
          x1 = int(round((w - crop_w) / 2.0))
          y1 = int(round((h - crop_h) / 2.0))
          img = img.crop((x1, y1, x1 + crop_w, y1 + crop_h))
          mask = mask.crop((x1, y1, x1 + crop_w, y1 + crop_h))
      elif self.resize:
          img = img.resize(self.crop_size, Image.BICUBIC)
          mask = mask.resize(self.crop_size, Image.NEAREST)
  
      # final transform
      img = self._img_transform(img)
      mask, edge_mask = self._mask_transform(mask)
      return img, mask, edge_mask
  
file_path: PaddleSeg/contrib/DomainAdaptation/datasets/cityscapes_noconfig.py
imports: import os
  import random
  import numpy
  import collections.abc
  from PIL import Image, ImageOps, ImageFilter, ImageFile
  import paddle
  from paddle import io
  import paddleseg.transforms.functional
label_desc: Use image node_id 5 for calling the CityDataset obj's underlying member method code with example usage: obj._val_sync_transform(img, mask) and returns: img,  mask,  edge_mask