class_docstr: Implement the paper :paper:`PanopticFPN`.
class_docstr_tok: ["Implement","the","paper",":","paper",":","`","PanopticFPN","`","."]
docstr: Args:
      batched_inputs: a list, batched outputs of :class:`DatasetMapper`.
          Each item in the list contains the inputs for one image.
  
          For now, each item in the list is a dict that contains:
  
          * "image": Tensor, image in (C, H, W) format.
          * "instances": Instances
          * "sem_seg": semantic segmentation ground truth.
          * Other information that's included in the original dicts, such as:
            "height", "width" (int): the output resolution of the model, used in inference.
            See :meth:`postprocess` for details.
  
  Returns:
      list[dict]:
          each dict has the results for one image. The dict contains the following keys:
  
          * "instances": see :meth:`GeneralizedRCNN.forward` for its format.
          * "sem_seg": see :meth:`SemanticSegmentor.forward` for its format.
          * "panoptic_seg": See the return value of
            :func:`combine_semantic_and_instance_outputs` for its format.
docstr_tok: ["Args",":","batched_inputs",":","a","list",",","batched","outputs","of",":","class",":","`","DatasetMapper","`",".","Each","item","in","the","list","contains","the","inputs","for","one","image",".","For","now",",","each","item","in","the","list","is","a","dict","that","contains",":","*","``","image","''",":","Tensor",",","image","in","(","C",",","H",",","W",")","format",".","*","``","instances","''",":","Instances","*","``","sem_seg","''",":","semantic","segmentation","ground","truth",".","*","Other","information","that","'s","included","in","the","original","dicts",",","such","as",":","``","height","''",",","``","width","''","(","int",")",":","the","output","resolution","of","the","model",",","used","in","inference",".","See",":","meth",":","`","postprocess","`","for","details",".","Returns",":","list","[","dict","]",":","each","dict","has","the","results","for","one","image",".","The","dict","contains","the","following","keys",":","*","``","instances","''",":","see",":","meth",":","`","GeneralizedRCNN.forward","`","for","its","format",".","*","``","sem_seg","''",":","see",":","meth",":","`","SemanticSegmentor.forward","`","for","its","format",".","*","``","panoptic_seg","''",":","See","the","return","value","of",":","func",":","`","combine_semantic_and_instance_outputs","`","for","its","format","."]
code: def forward(self, batched_inputs):
      """
      Args:
          batched_inputs: a list, batched outputs of :class:`DatasetMapper`.
              Each item in the list contains the inputs for one image.
  
              For now, each item in the list is a dict that contains:
  
              * "image": Tensor, image in (C, H, W) format.
              * "instances": Instances
              * "sem_seg": semantic segmentation ground truth.
              * Other information that's included in the original dicts, such as:
                "height", "width" (int): the output resolution of the model, used in inference.
                See :meth:`postprocess` for details.
  
      Returns:
          list[dict]:
              each dict has the results for one image. The dict contains the following keys:
  
              * "instances": see :meth:`GeneralizedRCNN.forward` for its format.
              * "sem_seg": see :meth:`SemanticSegmentor.forward` for its format.
              * "panoptic_seg": See the return value of
                :func:`combine_semantic_and_instance_outputs` for its format.
      """
      if not self.training:
          return self.inference(batched_inputs)
      images = self.preprocess_image(batched_inputs)
      features = self.backbone(images.tensor)
  
      assert "sem_seg" in batched_inputs[0]
      gt_sem_seg = [
          x["sem_seg"].to(self.device) for x in batched_inputs
      ]
      gt_sem_seg = ImageList.from_tensors(
          gt_sem_seg,
          self.backbone.size_divisibility,
          self.sem_seg_head.ignore_value,
          self.backbone.padding_constraints,
      ).tensor
      sem_seg_results, sem_seg_losses = self.sem_seg_head(
          features, gt_sem_seg
      )
  
      gt_instances = [
          x["instances"].to(self.device) for x in batched_inputs
      ]
      proposals, proposal_losses = self.proposal_generator(
          images, features, gt_instances
      )
      detector_results, detector_losses = self.roi_heads(
          images, features, proposals, gt_instances
      )
  
      losses = sem_seg_losses
      losses.update(proposal_losses)
      losses.update(detector_losses)
      return losses
  
file_path: detectron2/detectron2/modeling/meta_arch/panoptic_fpn.py
imports: import logging
  from typing import Dict, List
  import torch
  from torch import nn
  from detectron2.config import configurable
  from detectron2.structures import ImageList
  from ..postprocessing import detector_postprocess, sem_seg_postprocess
  from .build import META_ARCH_REGISTRY
  from .rcnn import GeneralizedRCNN
  from .semantic_seg import build_sem_seg_head
label_desc: Use image node_id 3 for calling the PanopticFPN obj's underlying member method code with example usage: obj.forward(batched_inputs) and returns: losses, self