class_docstr: Resize and Keep Aspect Ratio
      
class_docstr_tok: ["Resize","and","Keep","Aspect","Ratio"]
docstr: Args:
      size:
      longest:
      interpolation:
      random_scale_prob:
      random_scale_range:
      random_scale_area:
      random_aspect_prob:
      random_aspect_range:
docstr_tok: ["Args",":","size",":","longest",":","interpolation",":","random_scale_prob",":","random_scale_range",":","random_scale_area",":","random_aspect_prob",":","random_aspect_range",":"]
code: def __init__(
      self,
      size,
      longest=0.0,
      interpolation="bilinear",
      random_scale_prob=0.0,
      random_scale_range=(0.85, 1.05),
      random_scale_area=False,
      random_aspect_prob=0.0,
      random_aspect_range=(0.9, 1.11),
  ):
      """
  
      Args:
          size:
          longest:
          interpolation:
          random_scale_prob:
          random_scale_range:
          random_scale_area:
          random_aspect_prob:
          random_aspect_range:
      """
      if isinstance(size, (list, tuple)):
          self.size = tuple(size)
      else:
          self.size = (size, size)
      if interpolation == "random":
          self.interpolation = _RANDOM_INTERPOLATION
      else:
          self.interpolation = str_to_interp_mode(interpolation)
      self.longest = float(longest)
      self.random_scale_prob = random_scale_prob
      self.random_scale_range = random_scale_range
      self.random_scale_area = random_scale_area
      self.random_aspect_prob = random_aspect_prob
      self.random_aspect_range = random_aspect_range
  
imports: import math
  import numbers
  import random
  import warnings
  from typing import List, Sequence, Tuple, Union
  import torch
  import torchvision.transforms.functional
  from PIL import Image
  import numpy
label_desc: Use image node_id 1 to create a new ResizeKeepRatio object  with example: obj = ResizeKeepRatio(size, longest, interpolation, random_scale_prob, random_scale_range, random_scale_area, random_aspect_prob, random_aspect_range)