class_docstr: Extracts DensePose chart result with confidences from instances
class_docstr_tok: ["Extracts","DensePose","chart","result","with","confidences","from","instances"]
code: def __call__(
      self, instances: Instances, select=None
  ) -> Tuple[
      Optional[DensePoseChartResultsWithConfidences],
      Optional[torch.Tensor],
  ]:
      if instances.has("pred_densepose") and instances.has(
          "pred_boxes"
      ):
          dpout = instances.pred_densepose
          boxes_xyxy = instances.pred_boxes
          boxes_xywh = extract_boxes_xywh_from_instances(instances)
          if select is not None:
              dpout = dpout[select]
              boxes_xyxy = boxes_xyxy[select]
          converter = ToChartResultConverterWithConfidences()
          results = [
              converter.convert(dpout[i], boxes_xyxy[[i]])
              for i in range(len(dpout))
          ]
          return results, boxes_xywh
      else:
          return None, None
  
imports: import logging
  from typing import List, Optional, Sequence, Tuple
  import torch
  from detectron2.layers.nms import batched_nms
  from detectron2.structures.instances import Instances
  from densepose.converters import ToChartResultConverterWithConfidences
  from densepose.structures import DensePoseChartResultWithConfidences, DensePoseEmbeddingPredictorOutput
  from densepose.vis.bounding_box import BoundingBoxVisualizer, ScoredBoundingBoxVisualizer
  from densepose.vis.densepose_outputs_vertex import DensePoseOutputsVertexVisualizer
  from densepose.vis.densepose_results import DensePoseResultsVisualizer
  from .base import CompoundVisualizer
label_desc: Use image node_id 1 for calling the DensePoseResultExtractor obj's underlying member method code with example usage: obj.__call__(instances, select) and returns: results,  boxes_xywh, None,  None