def _compute_keypoint_estimation_losses(self, task_name, input_height, input_width, prediction_dict, per_pixel_weights):
    'Computes the weighted keypoint losses.'
    kp_params = self._kp_params_dict[task_name]
    heatmap_key = get_keypoint_name(task_name, KEYPOINT_HEATMAP)
    offset_key = get_keypoint_name(task_name, KEYPOINT_OFFSET)
    regression_key = get_keypoint_name(task_name, KEYPOINT_REGRESSION)
    heatmap_loss = self._compute_kp_heatmap_loss(input_height=input_height, input_width=input_width, task_name=task_name, heatmap_predictions=prediction_dict[heatmap_key], classification_loss_fn=kp_params.classification_loss, per_pixel_weights=per_pixel_weights)
    offset_loss = self._compute_kp_offset_loss(input_height=input_height, input_width=input_width, task_name=task_name, offset_predictions=prediction_dict[offset_key], localization_loss_fn=kp_params.localization_loss)
    reg_loss = self._compute_kp_regression_loss(input_height=input_height, input_width=input_width, task_name=task_name, regression_predictions=prediction_dict[regression_key], localization_loss_fn=kp_params.localization_loss)
    loss_dict = {}
    loss_dict[heatmap_key] = (kp_params.keypoint_heatmap_loss_weight * heatmap_loss)
    loss_dict[offset_key] = (kp_params.keypoint_offset_loss_weight * offset_loss)
    loss_dict[regression_key] = (kp_params.keypoint_regression_loss_weight * reg_loss)
    return loss_dict
Computes the weighted keypoint losses.
def _compute_keypoint_estimation_losses(self, task_name, input_height, input_width, prediction_dict, per_pixel_weights):
    
    kp_params = self._kp_params_dict[task_name]
    heatmap_key = get_keypoint_name(task_name, KEYPOINT_HEATMAP)
    offset_key = get_keypoint_name(task_name, KEYPOINT_OFFSET)
    regression_key = get_keypoint_name(task_name, KEYPOINT_REGRESSION)
    heatmap_loss = self._compute_kp_heatmap_loss(input_height=input_height, input_width=input_width, task_name=task_name, heatmap_predictions=prediction_dict[heatmap_key], classification_loss_fn=kp_params.classification_loss, per_pixel_weights=per_pixel_weights)
    offset_loss = self._compute_kp_offset_loss(input_height=input_height, input_width=input_width, task_name=task_name, offset_predictions=prediction_dict[offset_key], localization_loss_fn=kp_params.localization_loss)
    reg_loss = self._compute_kp_regression_loss(input_height=input_height, input_width=input_width, task_name=task_name, regression_predictions=prediction_dict[regression_key], localization_loss_fn=kp_params.localization_loss)
    loss_dict = {}
    loss_dict[heatmap_key] = (kp_params.keypoint_heatmap_loss_weight * heatmap_loss)
    loss_dict[offset_key] = (kp_params.keypoint_offset_loss_weight * offset_loss)
    loss_dict[regression_key] = (kp_params.keypoint_regression_loss_weight * reg_loss)
    return loss_dict