code: def predict_proposals(
      self,
      logits_pred,
      reg_pred,
      ctrness_pred,
      locations,
      image_sizes,
      top_feats=None,
  ):
      if self.training:
          self.pre_nms_thresh = self.pre_nms_thresh_train
          self.pre_nms_topk = self.pre_nms_topk_train
          self.post_nms_topk = self.post_nms_topk_train
      else:
          self.pre_nms_thresh = self.pre_nms_thresh_test
          self.pre_nms_topk = self.pre_nms_topk_test
          self.post_nms_topk = self.post_nms_topk_test
  
      sampled_boxes = []
  
      bundle = {
          "l": locations,
          "o": logits_pred,
          "r": reg_pred,
          "c": ctrness_pred,
          "s": self.strides,
      }
  
      if len(top_feats) > 0:
          bundle["t"] = top_feats
  
      for i, per_bundle in enumerate(zip(*bundle.values())):
          # get per-level bundle
          per_bundle = dict(zip(bundle.keys(), per_bundle))
          # recall that during training, we normalize regression targets with FPN's stride.
          # we denormalize them here.
          l = per_bundle["l"]
          o = per_bundle["o"]
          r = per_bundle["r"] * per_bundle["s"]
          c = per_bundle["c"]
          t = per_bundle["t"] if "t" in bundle else None
  
          sampled_boxes.append(
              self.forward_for_single_feature_map(
                  l, o, r, c, image_sizes, t
              )
          )
  
          for per_im_sampled_boxes in sampled_boxes[-1]:
              per_im_sampled_boxes.fpn_levels = (
                  l.new_ones(
                      len(per_im_sampled_boxes), dtype=torch.long
                  )
                  * i
              )
  
      boxlists = list(zip(*sampled_boxes))
      boxlists = [Instances.cat(boxlist) for boxlist in boxlists]
      boxlists = self.select_over_all_levels(boxlists)
  
      return boxlists
  
imports: import logging
  import math
  from typing import List, Dict
  import torch
  from torch import nn
  from torch.nn import functional
  from ...nn.shape_spec import ShapeSpec
  from ...nn.deform_conv import DeformConvWithChangeableStride
  from ...nn.group_norm import NaiveGroupNorm
  from ...data.structures import Instances, Boxes
  from ...nn.focal_loss import sigmoid_focal_loss_jit
  from ...nn.nms import ml_nms
  from ...utils.loss import IOULoss
  from ...utils.comm import get_world_size, reduce_sum, compute_locations
label_desc: Use image node_id 8 for calling the FCOSOutputs obj's underlying member method code with example usage: obj.predict_proposals(logits_pred, reg_pred, ctrness_pred, locations, image_sizes, top_feats) and returns: boxlists