code: def loss_bboxes(self, bbox_pred, targets, indices, avg_factor):
      bboxes = paddle.concat(
          [
              paddle.gather(src, src_idx, axis=0)
              for src, (src_idx, _) in zip(bbox_pred, indices)
          ]
      )
  
      tgt_bboxes = paddle.concat(
          [
              paddle.gather(tgt["boxes"], tgt_idx, axis=0)
              for tgt, (_, tgt_idx) in zip(targets, indices)
          ]
      )
      tgt_bboxes.stop_gradient = True
  
      im_shapes = paddle.concat(
          [tgt["img_whwh_tgt"] for tgt in targets]
      )
      bboxes_norm = bboxes / im_shapes
      tgt_bboxes_norm = tgt_bboxes / im_shapes
  
      loss_giou = self.giou_loss(bboxes, tgt_bboxes) / avg_factor
      loss_bbox = (
          F.l1_loss(bboxes_norm, tgt_bboxes_norm, reduction="sum")
          / avg_factor
      )
      losses = {
          "loss_bbox": loss_bbox * self.loss_weights["loss_bbox"],
          "loss_giou": loss_giou * self.loss_weights["loss_giou"],
      }
      return losses
  
file_path: PaddleDetection/ppdet/modeling/losses/queryinst_loss.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  import paddle.nn.functional
  from ppdet.core.workspace import register
  from ppdet.modeling.losses.iou_loss import GIoULoss
  from .sparsercnn_loss import HungarianMatcher
label_desc: Use image node_id 3 for calling the QueryInstLoss obj's underlying member method code with example usage: obj.loss_bboxes(bbox_pred, targets, indices, avg_factor) and returns: losses