code: def scale_aligned(self, img, scale):
      oh, ow = img.shape[0:2]
      h = int(oh * scale + 0.5)
      w = int(ow * scale + 0.5)
      if h % 32 != 0:
          h = h + (32 - h % 32)
      if w % 32 != 0:
          w = w + (32 - w % 32)
      img = cv2.resize(img, dsize=(w, h))
      factor_h = h / oh
      factor_w = w / ow
      return img, factor_h, factor_w
  
imports: import os
  import cv2
  import random
  import pyclipper
  import paddle
  import numpy
  from ppocr.utils.utility import check_install
  import scipy.io
  from PIL import Image
  import paddle.vision.transforms
label_desc: Use image node_id 2 for calling the RandomScale obj's underlying member method code with example usage: obj.scale_aligned(img, scale) and returns: img,  factor_h,  factor_w