class_docstr: Args:
      packed_annotations: object that contains packed annotations
      j_valid (:obj: `torch.Tensor`): uint8 tensor of size M containing
          0 for points to be discarded and 1 for points to be selected
      y_lo (:obj: `torch.Tensor`): int tensor of indices of upper values
          in z_est for each point
      y_hi (:obj: `torch.Tensor`): int tensor of indices of lower values
          in z_est for each point
      x_lo (:obj: `torch.Tensor`): int tensor of indices of left values
          in z_est for each point
      x_hi (:obj: `torch.Tensor`): int tensor of indices of right values
          in z_est for each point
      w_ylo_xlo (:obj: `torch.Tensor`): float tensor of size M;
          contains upper-left value weight for each point
      w_ylo_xhi (:obj: `torch.Tensor`): float tensor of size M;
          contains upper-right value weight for each point
      w_yhi_xlo (:obj: `torch.Tensor`): float tensor of size M;
          contains lower-left value weight for each point
      w_yhi_xhi (:obj: `torch.Tensor`): float tensor of size M;
          contains lower-right value weight for each point
class_docstr_tok: ["Args",":","packed_annotations",":","object","that","contains","packed","annotations","j_valid","(",":","obj",":","`","torch.Tensor","`",")",":","uint8","tensor","of","size","M","containing","0","for","points","to","be","discarded","and","1","for","points","to","be","selected","y_lo","(",":","obj",":","`","torch.Tensor","`",")",":","int","tensor","of","indices","of","upper","values","in","z_est","for","each","point","y_hi","(",":","obj",":","`","torch.Tensor","`",")",":","int","tensor","of","indices","of","lower","values","in","z_est","for","each","point","x_lo","(",":","obj",":","`","torch.Tensor","`",")",":","int","tensor","of","indices","of","left","values","in","z_est","for","each","point","x_hi","(",":","obj",":","`","torch.Tensor","`",")",":","int","tensor","of","indices","of","right","values","in","z_est","for","each","point","w_ylo_xlo","(",":","obj",":","`","torch.Tensor","`",")",":","float","tensor","of","size","M",";","contains","upper-left","value","weight","for","each","point","w_ylo_xhi","(",":","obj",":","`","torch.Tensor","`",")",":","float","tensor","of","size","M",";","contains","upper-right","value","weight","for","each","point","w_yhi_xlo","(",":","obj",":","`","torch.Tensor","`",")",":","float","tensor","of","size","M",";","contains","lower-left","value","weight","for","each","point","w_yhi_xhi","(",":","obj",":","`","torch.Tensor","`",")",":","float","tensor","of","size","M",";","contains","lower-right","value","weight","for","each","point"]
docstr: Args:
      packed_annotations: annotations packed into tensors, the following
          attributes are required:
           - bbox_xywh_gt
           - bbox_xywh_est
           - x_gt
           - y_gt
           - point_bbox_with_dp_indices
           - point_bbox_indices
      densepose_outputs_size_hw (tuple [int, int]): resolution of
          DensePose predictor outputs (H, W)
  Return:
      An instance of `BilinearInterpolationHelper` used to perform
      interpolation for the given annotation points and output resolution
docstr_tok: ["Args",":","packed_annotations",":","annotations","packed","into","tensors",",","the","following","attributes","are","required",":","-","bbox_xywh_gt","-","bbox_xywh_est","-","x_gt","-","y_gt","-","point_bbox_with_dp_indices","-","point_bbox_indices","densepose_outputs_size_hw","(","tuple","[","int",",","int","]",")",":","resolution","of","DensePose","predictor","outputs","(","H",",","W",")","Return",":","An","instance","of","`","BilinearInterpolationHelper","`","used","to","perform","interpolation","for","the","given","annotation","points","and","output","resolution"]
code: def from_matches(
      packed_annotations: Any,
      densepose_outputs_size_hw: Tuple[int, int],
  ) -> "BilinearInterpolationHelper":
      """
      Args:
          packed_annotations: annotations packed into tensors, the following
              attributes are required:
               - bbox_xywh_gt
               - bbox_xywh_est
               - x_gt
               - y_gt
               - point_bbox_with_dp_indices
               - point_bbox_indices
          densepose_outputs_size_hw (tuple [int, int]): resolution of
              DensePose predictor outputs (H, W)
      Return:
          An instance of `BilinearInterpolationHelper` used to perform
          interpolation for the given annotation points and output resolution
      """
  
      zh, zw = densepose_outputs_size_hw
      x0_gt, y0_gt, w_gt, h_gt = packed_annotations.bbox_xywh_gt[
          packed_annotations.point_bbox_with_dp_indices
      ].unbind(dim=1)
      x0_est, y0_est, w_est, h_est = packed_annotations.bbox_xywh_est[
          packed_annotations.point_bbox_with_dp_indices
      ].unbind(dim=1)
      x_lo, x_hi, x_w, jx_valid = _linear_interpolation_utilities(
          packed_annotations.x_gt, x0_gt, w_gt, x0_est, w_est, zw
      )
      y_lo, y_hi, y_w, jy_valid = _linear_interpolation_utilities(
          packed_annotations.y_gt, y0_gt, h_gt, y0_est, h_est, zh
      )
      j_valid = jx_valid * jy_valid
  
      w_ylo_xlo = (1.0 - x_w) * (1.0 - y_w)
      w_ylo_xhi = x_w * (1.0 - y_w)
      w_yhi_xlo = (1.0 - x_w) * y_w
      w_yhi_xhi = x_w * y_w
  
      return BilinearInterpolationHelper(
          packed_annotations,
          j_valid,
          y_lo,
          y_hi,
          x_lo,
          x_hi,
          w_ylo_xlo,  # pyre-ignore[6]
          w_ylo_xhi,
          # pyre-fixme[6]: Expected `Tensor` for 9th param but got `float`.
          w_yhi_xlo,
          w_yhi_xhi,
      )
  
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 BilinearInterpolationHelper obj's underlying member method code with example usage: obj.from_matches(packed_annotations, densepose_outputs_size_hw) and returns: BilinearInterpolationHelper