class_docstr: Performs input / target transformation before feeding the data to a GeneralizedRCNN
  model.
  
  The transformations it perform are:
      - input normalization (mean subtraction and std division)
      - input / target resizing to match min_size / max_size
  
  It returns a ImageList for the inputs, and a List[Dict[Tensor]] for the targets
class_docstr_tok: ["Performs","input","\/","target","transformation","before","feeding","the","data","to","a","GeneralizedRCNN","model",".","The","transformations","it","perform","are",":","-","input","normalization","(","mean","subtraction","and","std","division",")","-","input","\/","target","resizing","to","match","min_size","\/","max_size","It","returns","a","ImageList","for","the","inputs",",","and","a","List","[","Dict","[","Tensor","]","]","for","the","targets"]
docstr: 将图片缩放到指定的大小范围内，并对应缩放bboxes信息
  Args:
      image: 输入的图片
      target: 输入图片的相关信息（包括bboxes信息）
  
  Returns:
      image: 缩放后的图片
      target: 缩放bboxes后的图片相关信息
docstr_tok: ["\u5c06\u56fe\u7247\u7f29\u653e\u5230\u6307\u5b9a\u7684\u5927\u5c0f\u8303\u56f4\u5185\uff0c\u5e76\u5bf9\u5e94\u7f29\u653ebboxes\u4fe1\u606f","Args",":","image",":","\u8f93\u5165\u7684\u56fe\u7247","target",":","\u8f93\u5165\u56fe\u7247\u7684\u76f8\u5173\u4fe1\u606f\uff08\u5305\u62ecbboxes\u4fe1\u606f\uff09","Returns",":","image",":","\u7f29\u653e\u540e\u7684\u56fe\u7247","target",":","\u7f29\u653ebboxes\u540e\u7684\u56fe\u7247\u76f8\u5173\u4fe1\u606f"]
code: def resize(self, image, target):
      # type: (Tensor, Optional[Dict[str, Tensor]]) -> Tuple[Tensor, Optional[Dict[str, Tensor]]]
      """
      将图片缩放到指定的大小范围内，并对应缩放bboxes信息
      Args:
          image: 输入的图片
          target: 输入图片的相关信息（包括bboxes信息）
  
      Returns:
          image: 缩放后的图片
          target: 缩放bboxes后的图片相关信息
      """
      # image shape is [channel, height, width]
      h, w = image.shape[-2:]
  
      if self.training:
          size = float(
              self.torch_choice(self.min_size)
          )  # 指定输入图片的最小边长,注意是self.min_size不是min_size
      else:
          # FIXME assume for now that testing uses the largest scale
          size = float(
              self.min_size[-1]
          )  # 指定输入图片的最小边长,注意是self.min_size不是min_size
  
      if torchvision._is_tracing():
          image = _resize_image_onnx(image, size, float(self.max_size))
      else:
          image = _resize_image(image, size, float(self.max_size))
  
      if target is None:
          return image, target
  
      bbox = target["boxes"]
      # 根据图像的缩放比例来缩放bbox
      bbox = resize_boxes(bbox, [h, w], image.shape[-2:])
      target["boxes"] = bbox
  
      return image, target
  
imports: import math
  from typing import List, Tuple, Dict, Optional
  import torch
  from torch import nn, Tensor
  import torchvision
  from .image_list import ImageList
label_desc: Use image node_id 4 for calling the GeneralizedRCNNTransform obj's underlying member method code with example usage: obj.resize(image, target) and returns: image,  target, image,  target