code: def crop_image(img, target_size, center):
      width, height = img.size
      size = target_size
      if center == True:
          w_start = (width - size) / 2
          h_start = (height - size) / 2
      else:
          w_start = np.random.randint(0, width - size + 1)
          h_start = np.random.randint(0, height - size + 1)
      w_end = w_start + size
      h_end = h_start + size
      img = img.crop((w_start, h_start, w_end, h_end))
      return img
  
file_path: PaddleHub/modules/image/classification/resnet50_vd_wildanimals/data_feed.py
imports: import os
  import time
  from collections import OrderedDict
  import numpy
  from PIL import Image
label_desc: Use image node_id 2 for calling a global function with example usage: crop_image(img, target_size, center) and returns: img