class_docstr: Accumulates annotations by batches that correspond to objects detected on
  individual images. Can pack them together into single tensors.
class_docstr_tok: ["Accumulates","annotations","by","batches","that","correspond","to","objects","detected","on","individual","images",".","Can","pack","them","together","into","single","tensors","."]
docstr: Accumulate instances data for one image
  
  Args:
      instances_one_image (Instances): instances data to accumulate
docstr_tok: ["Accumulate","instances","data","for","one","image","Args",":","instances_one_image","(","Instances",")",":","instances","data","to","accumulate"]
code: def accumulate(self, instances_one_image: Instances):
      """
      Accumulate instances data for one image
  
      Args:
          instances_one_image (Instances): instances data to accumulate
      """
      boxes_xywh_est = BoxMode.convert(
          instances_one_image.proposal_boxes.tensor.clone(),
          BoxMode.XYXY_ABS,
          BoxMode.XYWH_ABS,
      )
      boxes_xywh_gt = BoxMode.convert(
          instances_one_image.gt_boxes.tensor.clone(),
          BoxMode.XYXY_ABS,
          BoxMode.XYWH_ABS,
      )
      n_matches = len(boxes_xywh_gt)
      assert n_matches == len(
          boxes_xywh_est
      ), f"Got {len(boxes_xywh_est)} proposal boxes and {len(boxes_xywh_gt)} GT boxes"
      if not n_matches:
          # no detection - GT matches
          return
      if (
          not hasattr(instances_one_image, "gt_densepose")
          or instances_one_image.gt_densepose is None
      ):
          # no densepose GT for the detections, just increase the bbox index
          self.nxt_bbox_index += n_matches
          return
      for box_xywh_est, box_xywh_gt, dp_gt in zip(
          boxes_xywh_est,
          boxes_xywh_gt,
          instances_one_image.gt_densepose,
      ):
          if (dp_gt is not None) and (len(dp_gt.x) > 0):
              # pyre-fixme[6]: For 1st argument expected `Tensor` but got `float`.
              # pyre-fixme[6]: For 2nd argument expected `Tensor` but got `float`.
              self._do_accumulate(box_xywh_gt, box_xywh_est, dp_gt)
          self.nxt_bbox_index += 1
  
imports: from abc import ABC, abstractmethod
  from dataclasses import dataclass
  from typing import Any, Dict, List, Optional, Tuple
  import torch
  from torch.nn import functional
  from detectron2.structures import BoxMode, Instances
  from densepose import DensePoseDataRelative
label_desc: Use image node_id 2 for calling the ChartBasedAnnotationsAccumulator obj's underlying member method code with example usage: obj.accumulate(instances_one_image) without return types