docstr: Extract arrays of I, U and V values at given points as numpy arrays
  given the data mode stored in self._dpDataMode
docstr_tok: ["Extract","arrays","of","I",",","U","and","V","values","at","given","points","as","numpy","arrays","given","the","data","mode","stored","in","self._dpDataMode"]
code: def _extract_iuv(
      self,
      densepose_data: np.ndarray,
      py: np.ndarray,
      px: np.ndarray,
      gt: Dict[str, Any],
  ) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
      """
      Extract arrays of I, U and V values at given points as numpy arrays
      given the data mode stored in self._dpDataMode
      """
      if self._dpDataMode == DensePoseDataMode.IUV_DT:
          # estimated labels and UV (default)
          ipoints = densepose_data[0, py, px]
          upoints = (
              densepose_data[1, py, px] / 255.0
          )  # convert from uint8 by /255.
          vpoints = densepose_data[2, py, px] / 255.0
      elif self._dpDataMode == DensePoseDataMode.IUV_GT:
          # ground truth
          ipoints = np.array(gt["dp_I"])
          upoints = np.array(gt["dp_U"])
          vpoints = np.array(gt["dp_V"])
      elif self._dpDataMode == DensePoseDataMode.I_GT_UV_0:
          # ground truth labels, UV = 0
          ipoints = np.array(gt["dp_I"])
          upoints = upoints * 0.0
          vpoints = vpoints * 0.0
      elif self._dpDataMode == DensePoseDataMode.I_GT_UV_DT:
          # ground truth labels, estimated UV
          ipoints = np.array(gt["dp_I"])
          upoints = (
              densepose_data[1, py, px] / 255.0
          )  # convert from uint8 by /255.
          vpoints = densepose_data[2, py, px] / 255.0
      elif self._dpDataMode == DensePoseDataMode.I_DT_UV_0:
          # estimated labels, UV = 0
          ipoints = densepose_data[0, py, px]
          upoints = upoints * 0.0
          vpoints = vpoints * 0.0
      else:
          raise ValueError(f"Unknown data mode: {self._dpDataMode}")
      return ipoints, upoints, vpoints
  
imports: import copy
  import datetime
  import logging
  import numpy
  import pickle
  import time
  from collections import defaultdict
  from enum import Enum
  from typing import Any, Dict, Tuple
  import scipy.spatial.distance
  import torch
  import torch.nn.functional
  from pycocotools import mask
  from scipy.io import loadmat
  from scipy.ndimage import zoom
  from detectron2.utils.file_io import PathManager
  from densepose.converters.chart_output_to_chart_result import resample_uv_tensors_to_bbox
  from densepose.converters.segm_to_mask import resample_coarse_segm_tensor_to_bbox, resample_fine_and_coarse_segm_tensors_to_bbox
  from densepose.modeling.cse.utils import squared_euclidean_distance_matrix
  from densepose.structures import DensePoseDataRelative
  from densepose.structures.mesh import create_mesh
label_desc: Use image node_id 11 for calling the DensePoseCocoEval obj's underlying member method code with example usage: obj._extract_iuv(densepose_data, py, px, gt) and returns: ipoints,  upoints,  vpoints