code: def _data_aug_fn(im, ann):
      ## parse annotation
      ann = ann.decode()
      ann = tl.prepro.parse_darknet_ann_str_to_list(ann)
      clas, coords = tl.prepro.parse_darknet_ann_list_to_cls_box(ann)
      ## random brightness, contrast and saturation (tf.image API is faster)
      # im = tl.prepro.brightness(im, gamma=0.5, gain=1, is_random=True)
      # im = tl.prepro.illumination(im, gamma=(0.5, 1.5),
      #          contrast=(0.5, 1.5), saturation=(0.5, 1.5), is_random=True)    # TypeError: Cannot handle this data type
      ## random horizontal flip
      im, coords = tl.prepro.obj_box_left_right_flip(
          im, coords, is_rescale=True, is_center=True, is_random=True
      )
      ## random resize and crop
      tmp0 = random.randint(1, int(im_size[0] * jitter))
      tmp1 = random.randint(1, int(im_size[1] * jitter))
      im, coords = tl.prepro.obj_box_imresize(
          im,
          coords,
          [im_size[0] + tmp0, im_size[1] + tmp1],
          is_rescale=True,
          interp="bicubic",
      )
      im, clas, coords = tl.prepro.obj_box_crop(
          im,
          clas,
          coords,
          wrg=im_size[1],
          hrg=im_size[0],
          is_rescale=True,
          is_center=True,
          is_random=True,
      )
      ## value [0, 255] to [-1, 1] (optional)
      # im = im / 127.5 - 1
      ## value [0, 255] to [0, 1] (optional)
      im = im / 255
      im = np.array(im, dtype=np.float32)  # important
      return im, str([clas, coords]).encode("utf-8")
  
file_path: TensorLayer/examples/data_process/tutorial_tf_dataset_voc.py
imports: import json
  import multiprocessing
  import random
  import time
  import numpy
  import tensorflow
  import tensorlayer
label_desc: Use image node_id 2 for calling a global function with example usage: _data_aug_fn(im, ann) and returns: im,  str