def _compute_densepose_losses(self, input_height, input_width, prediction_dict):
    'Computes the weighted DensePose losses.\n\n    Args:\n      input_height: An integer scalar tensor representing input image height.\n      input_width: An integer scalar tensor representing input image width.\n      prediction_dict: A dictionary holding predicted tensors output by the\n        "predict" function. See the "predict" function for more detailed\n        description.\n\n    Returns:\n      A dictionary of scalar float tensors representing the weighted losses for\n      the DensePose task:\n         DENSEPOSE_HEATMAP: the weighted part segmentation loss.\n         DENSEPOSE_REGRESSION: the weighted part surface coordinate loss.\n    '
    (dp_heatmap_loss, dp_regression_loss) = self._compute_densepose_part_and_coordinate_losses(input_height=input_height, input_width=input_width, part_predictions=prediction_dict[DENSEPOSE_HEATMAP], surface_coord_predictions=prediction_dict[DENSEPOSE_REGRESSION])
    loss_dict = {}
    loss_dict[DENSEPOSE_HEATMAP] = (self._densepose_params.part_loss_weight * dp_heatmap_loss)
    loss_dict[DENSEPOSE_REGRESSION] = (self._densepose_params.coordinate_loss_weight * dp_regression_loss)
    return loss_dict
Computes the weighted DensePose losses.

Args:
  input_height: An integer scalar tensor representing input image height.
  input_width: An integer scalar tensor representing input image width.
  prediction_dict: A dictionary holding predicted tensors output by the
    "predict" function. See the "predict" function for more detailed
    description.

Returns:
  A dictionary of scalar float tensors representing the weighted losses for
  the DensePose task:
     DENSEPOSE_HEATMAP: the weighted part segmentation loss.
     DENSEPOSE_REGRESSION: the weighted part surface coordinate loss.
def _compute_densepose_losses(self, input_height, input_width, prediction_dict):
    'Computes the weighted DensePose losses.\n\n    Args:\n      input_height: An integer scalar tensor representing input image height.\n      input_width: An integer scalar tensor representing input image width.\n      prediction_dict: A dictionary holding predicted tensors output by the\n        "predict" function. See the "predict" function for more detailed\n        description.\n\n    Returns:\n      A dictionary of scalar float tensors representing the weighted losses for\n      the DensePose task:\n         DENSEPOSE_HEATMAP: the weighted part segmentation loss.\n         DENSEPOSE_REGRESSION: the weighted part surface coordinate loss.\n    '
    (dp_heatmap_loss, dp_regression_loss) = self._compute_densepose_part_and_coordinate_losses(input_height=input_height, input_width=input_width, part_predictions=prediction_dict[DENSEPOSE_HEATMAP], surface_coord_predictions=prediction_dict[DENSEPOSE_REGRESSION])
    loss_dict = {}
    loss_dict[DENSEPOSE_HEATMAP] = (self._densepose_params.part_loss_weight * dp_heatmap_loss)
    loss_dict[DENSEPOSE_REGRESSION] = (self._densepose_params.coordinate_loss_weight * dp_regression_loss)
    return loss_dict