code: def forward(self, outputs: Dict[str, Tensor], target_sizes: Tensor):
      out_logits, out_bbox = (
          outputs["pred_logits"],
          outputs["pred_boxes"],
      )
  
      assert len(out_logits) == len(target_sizes)
      assert target_sizes.shape[1] == 2
  
      prob = F.softmax(out_logits, -1)
      scores, labels = prob[..., :-1].max(-1)
  
      # convert to [x0, y0, x1, y1] format
      from mmf.utils.box_ops import box_cxcywh_to_xyxy
  
      boxes = box_cxcywh_to_xyxy(out_bbox)
      # and from relative [0, 1] to absolute [0, height] coordinates
      img_h, img_w = target_sizes.unbind(1)
      scale_fct = torch.stack([img_w, img_h, img_w, img_h], dim=1)
      boxes = boxes * scale_fct[:, None, :]
  
      results = [
          {"scores": s, "labels": l, "boxes": b}
          for s, l, b in zip(scores, labels, boxes)
      ]
  
      if "attr_logits" in outputs:
          assert len(outputs["attr_logits"]) == len(results)
          attr_scores, attr_labels = outputs["attr_logits"].max(-1)
          for idx, r in enumerate(results):
              r["attr_scores"] = attr_scores[idx]
              r["attr_labels"] = attr_labels[idx]
  
      return results
  
file_path: mmf/mmf/datasets/builders/coco/detection_dataset.py
imports: import os
  from typing import Dict
  import torch
  import torch.nn.functional
  import torchvision
  from mmf.common.sample import Sample
  from mmf.datasets.base_dataset import BaseDataset
  from mmf.utils.distributed import gather_tensor_along_batch, object_to_byte_tensor
  from torch import nn, Tensor
label_desc: Use image node_id 1 for calling the PostProcess obj's underlying member method code with example usage: obj.forward(outputs, target_sizes) and returns: results