code: def rescale_image(image, stride_width=64):
      # make sure smallest size is 600 pixels wide & dimensions are (k * stride_width) + 1
      height, width = image.shape
  
      # Taken from 'szross'
      scale_up = 625.0 / min(height, width)
      scale_cap = 961.0 / max(height, width)
      scale_up = min(scale_up, scale_cap)
      new_height = (
          stride_width * round((height * scale_up) / stride_width) + 1
      )
      new_width = (
          stride_width * round((width * scale_up) / stride_width) + 1
      )
      image, tr = image.resize(
          [new_height, new_width], return_transform=True
      )
      image.inverse_tr = tr
      return image
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  import menpo.io
  from menpo.image import Image
  from menpo.shape import PointCloud
  import cv2
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.contrib.framework.python.ops import variables
  from tensorflow.python.training import optimizer
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import variables
  from menpo.transform import Translation, Scale
  from menpo.shape import PointCloud
label_desc: Use image node_id 4 for calling a global function with example usage: rescale_image(image, stride_width) and returns: image