code: def get_loss(self):
      targets = []
      for i in range(len(self.inputs["img_whwh"])):
          boxes = self.inputs["gt_bbox"][i]
          labels = self.inputs["gt_class"][i].squeeze(-1)
          img_whwh = self.inputs["img_whwh"][i]
          if boxes.shape[0] != 0:
              img_whwh_tgt = img_whwh.unsqueeze(0).tile(
                  [boxes.shape[0], 1]
              )
          else:
              img_whwh_tgt = paddle.zeros_like(boxes)
          gt_segm = self.inputs["gt_segm"][i].astype("float32")
          targets.append(
              {
                  "boxes": boxes,
                  "labels": labels,
                  "img_whwh": img_whwh,
                  "img_whwh_tgt": img_whwh_tgt,
                  "gt_segm": gt_segm,
              }
          )
      losses = self._forward(targets)
      losses.update({"loss": sum(losses.values())})
      return losses
  
file_path: PaddleDetection/ppdet/modeling/architectures/queryinst.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  from ppdet.core.workspace import register, create
  from .meta_arch import BaseArch
label_desc: Use image node_id 4 for calling the QueryInst obj's underlying member method code with example usage: obj.get_loss() and returns: losses