code: def group_scale(imgs, target_size):
      resized_imgs = []
      for i in range(len(imgs)):
          img = imgs[i]
          w, h = img.size
          if (w <= h and w == target_size) or (
              h <= w and h == target_size
          ):
              resized_imgs.append(img)
              continue
  
          if w < h:
              ow = target_size
              oh = int(target_size * 4.0 / 3.0)
              resized_imgs.append(img.resize((ow, oh), Image.BILINEAR))
          else:
              oh = target_size
              ow = int(target_size * 4.0 / 3.0)
              resized_imgs.append(img.resize((ow, oh), Image.BILINEAR))
  
      return resized_imgs
  
file_path: PaddleHub/modules/video/classification/videotag_tsn_lstm/resource/reader/kinetics_reader.py
imports: import sys
  import random
  import functools
  import logging
  import paddle
  import cv2
  import numpy
  from PIL import Image
  from .reader_utils import DataReader
label_desc: Use image node_id 3 for calling a global function with example usage: group_scale(imgs, target_size) and returns: resized_imgs