code: def resize_img(img, input_size=600):
      img = np.array(img)
      im_shape = img.shape
      im_size_min = np.min(im_shape[0:2])
      im_size_max = np.max(im_shape[0:2])
      im_scale = float(input_size) / float(im_size_max)
      im = cv2.resize(img, None, None, fx=im_scale, fy=im_scale)
      return im
  
file_path: PaddleHub/modules/image/text_recognition/chinese_ocr_db_crnn_server/utils.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import base64
  import math
  from io import BytesIO
  import cv2
  import numpy
  from PIL import Image
  from PIL import ImageDraw
  from PIL import ImageFont
label_desc: Use image node_id 4 for calling a global function with example usage: resize_img(img, input_size) and returns: im