class_docstr: The ROI heads that implement :paper:`Cascade R-CNN`.
class_docstr_tok: ["The","ROI","heads","that","implement",":","paper",":","`","Cascade","R-CNN","`","."]
docstr: Args:
      boxes (list[Tensor]): per-image predicted boxes, each of shape Ri x 4
      image_sizes (list[tuple]): list of image shapes in (h, w)
  
  Returns:
      list[Instances]: per-image proposals with the given boxes.
docstr_tok: ["Args",":","boxes","(","list","[","Tensor","]",")",":","per-image","predicted","boxes",",","each","of","shape","Ri","x","4","image_sizes","(","list","[","tuple","]",")",":","list","of","image","shapes","in","(","h",",","w",")","Returns",":","list","[","Instances","]",":","per-image","proposals","with","the","given","boxes","."]
code: def _create_proposals_from_boxes(self, boxes, image_sizes):
      """
      Args:
          boxes (list[Tensor]): per-image predicted boxes, each of shape Ri x 4
          image_sizes (list[tuple]): list of image shapes in (h, w)
  
      Returns:
          list[Instances]: per-image proposals with the given boxes.
      """
      # Just like RPN, the proposals should not have gradients
      boxes = [Boxes(b.detach()) for b in boxes]
      proposals = []
      for boxes_per_image, image_size in zip(boxes, image_sizes):
          boxes_per_image.clip(image_size)
          if self.training:
              # do not filter empty boxes at inference time,
              # because the scores from each stage need to be aligned and added later
              boxes_per_image = boxes_per_image[
                  boxes_per_image.nonempty()
              ]
          prop = Instances(image_size)
          prop.proposal_boxes = boxes_per_image
          proposals.append(prop)
      return proposals
  
imports: from typing import List
  import torch
  from torch import nn
  from torch.autograd.function import Function
  from detectron2.config import configurable
  from detectron2.layers import ShapeSpec
  from detectron2.structures import Boxes, Instances, pairwise_iou
  from detectron2.utils.events import get_event_storage
  from ..box_regression import Box2BoxTransform
  from ..matcher import Matcher
  from ..poolers import ROIPooler
  from .box_head import build_box_head
  from .fast_rcnn import FastRCNNOutputLayers, fast_rcnn_inference
  from .roi_heads import ROI_HEADS_REGISTRY, StandardROIHeads
label_desc: Use image node_id 8 for calling the CascadeROIHeads obj's underlying member method code with example usage: obj._create_proposals_from_boxes(boxes, image_sizes) and returns: proposals