class_docstr: Extracts DensePose result from instances
class_docstr_tok: ["Extracts","DensePose","result","from","instances"]
code: def __call__(
      self,
      instances: Instances,
      select=None,
  ) -> Tuple[
      Optional[DensePoseEmbeddingPredictorOutput],
      Optional[torch.Tensor],
      Optional[List[int]],
  ]:
      if not (
          instances.has("pred_densepose")
          and instances.has("pred_boxes")
      ):
          return None, None, None
  
      dpout = instances.pred_densepose
      boxes_xyxy = instances.pred_boxes
      boxes_xywh = extract_boxes_xywh_from_instances(instances)
  
      if instances.has("pred_classes"):
          classes = instances.pred_classes.tolist()
      else:
          classes = None
  
      if select is not None:
          dpout = dpout[select]
          boxes_xyxy = boxes_xyxy[select]
          if classes is not None:
              classes = classes[select]
  
      return dpout, boxes_xywh, classes
  
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 DensePoseOutputsExtractor obj's underlying member method code with example usage: obj.__call__(instances, select) and returns: dpout,  boxes_xywh,  classes, None,  None,  None