class_docstr: Segmentation Base Dataset
class_docstr_tok: ["Segmentation","Base","Dataset"]
code: def _val_sync_transform(self, img, mask):
      outsize = self.crop_size
      short_size = outsize
      w, h = img.size
      if w > h:
          oh = short_size
          ow = int(1.0 * w * oh / h)
      else:
          ow = short_size
          oh = int(1.0 * h * ow / w)
      img = img.resize((ow, oh), Image.BILINEAR)
      mask = mask.resize((ow, oh), Image.NEAREST)
      # center crop
      w, h = img.size
      x1 = int(round((w - outsize) / 2.0))
      y1 = int(round((h - outsize) / 2.0))
      img = img.crop((x1, y1, x1 + outsize, y1 + outsize))
      mask = mask.crop((x1, y1, x1 + outsize, y1 + outsize))
      # final transform
      img, mask = self._img_transform(img), self._mask_transform(mask)
      return img, mask
  
file_path: gluon-cv/gluoncv/data/segbase.py
imports: import random
  import numpy
  from PIL import Image, ImageOps, ImageFilter
  import mxnet
  from mxnet import cpu
  import mxnet.ndarray
  from .base import VisionDataset
label_desc: Use image node_id 2 for calling the SegmentationDataset obj's underlying member method code with example usage: obj._val_sync_transform(img, mask) and returns: img,  mask