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:
      result: list(dict), 网络的预测结果, len(result) == batch_size
      image_shapes: list(torch.Size), 图像预处理缩放后的尺寸, len(image_shapes) == batch_size
      original_image_sizes: list(torch.Size), 图像的原始尺寸, len(original_image_sizes) == batch_size
  
  Returns:
docstr_tok: ["\u5bf9\u7f51\u7edc\u7684\u9884\u6d4b\u7ed3\u679c\u8fdb\u884c\u540e\u5904\u7406\uff08\u4e3b\u8981\u5c06bboxes\u8fd8\u539f\u5230\u539f\u56fe\u50cf\u5c3a\u5ea6\u4e0a\uff09","Args",":","result",":","list","(","dict",")",",","\u7f51\u7edc\u7684\u9884\u6d4b\u7ed3\u679c",",","len","(","result",")","==","batch_size","image_shapes",":","list","(","torch.Size",")",",","\u56fe\u50cf\u9884\u5904\u7406\u7f29\u653e\u540e\u7684\u5c3a\u5bf8",",","len","(","image_shapes",")","==","batch_size","original_image_sizes",":","list","(","torch.Size",")",",","\u56fe\u50cf\u7684\u539f\u59cb\u5c3a\u5bf8",",","len","(","original_image_sizes",")","==","batch_size","Returns",":"]
code: def postprocess(
      self,
      result,  # type: List[Dict[str, Tensor]]
      image_shapes,  # type: List[Tuple[int, int]]
      original_image_sizes,  # type: List[Tuple[int, int]]
  ):
      # type: (...) -> List[Dict[str, Tensor]]
      """
      对网络的预测结果进行后处理（主要将bboxes还原到原图像尺度上）
      Args:
          result: list(dict), 网络的预测结果, len(result) == batch_size
          image_shapes: list(torch.Size), 图像预处理缩放后的尺寸, len(image_shapes) == batch_size
          original_image_sizes: list(torch.Size), 图像的原始尺寸, len(original_image_sizes) == batch_size
  
      Returns:
  
      """
      if self.training:
          return result
  
      # 遍历每张图片的预测信息，将boxes信息还原回原尺度
      for i, (pred, im_s, o_im_s) in enumerate(
          zip(result, image_shapes, original_image_sizes)
      ):
          boxes = pred["boxes"]
          boxes = resize_boxes(boxes, im_s, o_im_s)  # 将bboxes缩放回原图像尺度上
          result[i]["boxes"] = boxes
          if "masks" in pred:
              masks = pred["masks"]
              # 将mask映射回原图尺度
              masks = paste_masks_in_image(masks, boxes, o_im_s)
              result[i]["masks"] = masks
  
      return result
  
imports: import math
  from typing import List, Tuple, Dict, Optional
  import torch
  from torch import nn, Tensor
  import torch.nn.functional
  import torchvision
  from .image_list import ImageList
label_desc: Use image node_id 8 for calling the GeneralizedRCNNTransform obj's underlying member method code with example usage: obj.postprocess(result, image_shapes, original_image_sizes) and returns: result, result