def postprocess(self, prediction_dict, true_image_shapes, **params):
    'Produces boxes given a prediction dict returned by predict().\n\n    Although predict returns a list of tensors, only the last tensor in\n    each list is used for making box predictions.\n\n    Args:\n      prediction_dict: a dictionary holding predicted tensors from "predict"\n        function.\n      true_image_shapes: int32 tensor of shape [batch, 3] where each row is of\n        the form [height, width, channels] indicating the shapes of true images\n        in the resized images, as resized images can be padded with zeros.\n      **params: Currently ignored.\n\n    Returns:\n      detections: a dictionary containing the following fields\n        detection_boxes - A tensor of shape [batch, max_detections, 4]\n          holding the predicted boxes.\n        detection_boxes_strided: A tensor of shape [batch_size, num_detections,\n          4] holding the predicted boxes in absolute coordinates of the\n          feature extractor\'s final layer output.\n        detection_scores: A tensor of shape [batch, max_detections] holding\n          the predicted score for each box.\n        detection_classes: An integer tensor of shape [batch, max_detections]\n          containing the detected class for each box.\n        num_detections: An integer tensor of shape [batch] containing the\n          number of detected boxes for each sample in the batch.\n        detection_keypoints: (Optional) A float tensor of shape [batch,\n          max_detections, num_keypoints, 2] with normalized keypoints. Any\n          invalid keypoints have their coordinates and scores set to 0.0.\n        detection_keypoint_scores: (Optional) A float tensor of shape [batch,\n          max_detection, num_keypoints] with scores for each keypoint.\n        detection_masks: (Optional) A uint8 tensor of shape [batch,\n          max_detections, mask_height, mask_width] with masks for each\n          detection. Background is specified with 0, and foreground is specified\n          with positive integers (1 for standard instance segmentation mask, and\n          1-indexed parts for DensePose task).\n        detection_surface_coords: (Optional) A float32 tensor of shape [batch,\n          max_detection, mask_height, mask_width, 2] with DensePose surface\n          coordinates, in (v, u) format.\n        detection_embeddings: (Optional) A float tensor of shape [batch,\n          max_detections, reid_embed_size] containing object embeddings.\n    '
    object_center_prob = tf.nn.sigmoid(prediction_dict[OBJECT_CENTER][(- 1)])
    (detection_scores, y_indices, x_indices, channel_indices) = top_k_feature_map_locations(object_center_prob, max_pool_kernel_size=3, k=self._center_params.max_box_predictions)
    (boxes_strided, classes, scores, num_detections) = prediction_tensors_to_boxes(detection_scores, y_indices, x_indices, channel_indices, prediction_dict[BOX_SCALE][(- 1)], prediction_dict[BOX_OFFSET][(- 1)])
    boxes = convert_strided_predictions_to_normalized_boxes(boxes_strided, self._stride, true_image_shapes)
    postprocess_dict = {fields.DetectionResultFields.detection_boxes: boxes, fields.DetectionResultFields.detection_scores: scores, fields.DetectionResultFields.detection_classes: classes, fields.DetectionResultFields.num_detections: num_detections, 'detection_boxes_strided': boxes_strided}
    if self._kp_params_dict:
        (keypoints, keypoint_scores) = self._postprocess_keypoints(prediction_dict, classes, y_indices, x_indices, boxes_strided, num_detections)
        (keypoints, keypoint_scores) = convert_strided_predictions_to_normalized_keypoints(keypoints, keypoint_scores, self._stride, true_image_shapes, clip_out_of_frame_keypoints=True)
        postprocess_dict.update({fields.DetectionResultFields.detection_keypoints: keypoints, fields.DetectionResultFields.detection_keypoint_scores: keypoint_scores})
    if self._mask_params:
        masks = tf.nn.sigmoid(prediction_dict[SEGMENTATION_HEATMAP][(- 1)])
        (densepose_part_heatmap, densepose_surface_coords) = (None, None)
        densepose_class_index = 0
        if self._densepose_params:
            densepose_part_heatmap = prediction_dict[DENSEPOSE_HEATMAP][(- 1)]
            densepose_surface_coords = prediction_dict[DENSEPOSE_REGRESSION][(- 1)]
            densepose_class_index = self._densepose_params.class_id
        (instance_masks, surface_coords) = convert_strided_predictions_to_instance_masks(boxes, classes, masks, true_image_shapes, densepose_part_heatmap, densepose_surface_coords, stride=self._stride, mask_height=self._mask_params.mask_height, mask_width=self._mask_params.mask_width, score_threshold=self._mask_params.score_threshold, densepose_class_index=densepose_class_index)
        postprocess_dict[fields.DetectionResultFields.detection_masks] = instance_masks
        if self._densepose_params:
            postprocess_dict[fields.DetectionResultFields.detection_surface_coords] = surface_coords
    if self._track_params:
        embeddings = self._postprocess_embeddings(prediction_dict, y_indices, x_indices)
        postprocess_dict.update({fields.DetectionResultFields.detection_embeddings: embeddings})
    if self._temporal_offset_params:
        offsets = prediction_tensors_to_temporal_offsets(y_indices, x_indices, prediction_dict[TEMPORAL_OFFSET][(- 1)])
        postprocess_dict[fields.DetectionResultFields.detection_offsets] = offsets
    return postprocess_dict
Produces boxes given a prediction dict returned by predict().

Although predict returns a list of tensors, only the last tensor in
each list is used for making box predictions.

Args:
  prediction_dict: a dictionary holding predicted tensors from "predict"
    function.
  true_image_shapes: int32 tensor of shape [batch, 3] where each row is of
    the form [height, width, channels] indicating the shapes of true images
    in the resized images, as resized images can be padded with zeros.
  **params: Currently ignored.

Returns:
  detections: a dictionary containing the following fields
    detection_boxes - A tensor of shape [batch, max_detections, 4]
      holding the predicted boxes.
    detection_boxes_strided: A tensor of shape [batch_size, num_detections,
      4] holding the predicted boxes in absolute coordinates of the
      feature extractor's final layer output.
    detection_scores: A tensor of shape [batch, max_detections] holding
      the predicted score for each box.
    detection_classes: An integer tensor of shape [batch, max_detections]
      containing the detected class for each box.
    num_detections: An integer tensor of shape [batch] containing the
      number of detected boxes for each sample in the batch.
    detection_keypoints: (Optional) A float tensor of shape [batch,
      max_detections, num_keypoints, 2] with normalized keypoints. Any
      invalid keypoints have their coordinates and scores set to 0.0.
    detection_keypoint_scores: (Optional) A float tensor of shape [batch,
      max_detection, num_keypoints] with scores for each keypoint.
    detection_masks: (Optional) A uint8 tensor of shape [batch,
      max_detections, mask_height, mask_width] with masks for each
      detection. Background is specified with 0, and foreground is specified
      with positive integers (1 for standard instance segmentation mask, and
      1-indexed parts for DensePose task).
    detection_surface_coords: (Optional) A float32 tensor of shape [batch,
      max_detection, mask_height, mask_width, 2] with DensePose surface
      coordinates, in (v, u) format.
    detection_embeddings: (Optional) A float tensor of shape [batch,
      max_detections, reid_embed_size] containing object embeddings.
def postprocess(self, prediction_dict, true_image_shapes, **params):
    'Produces boxes given a prediction dict returned by predict().\n\n    Although predict returns a list of tensors, only the last tensor in\n    each list is used for making box predictions.\n\n    Args:\n      prediction_dict: a dictionary holding predicted tensors from "predict"\n        function.\n      true_image_shapes: int32 tensor of shape [batch, 3] where each row is of\n        the form [height, width, channels] indicating the shapes of true images\n        in the resized images, as resized images can be padded with zeros.\n      **params: Currently ignored.\n\n    Returns:\n      detections: a dictionary containing the following fields\n        detection_boxes - A tensor of shape [batch, max_detections, 4]\n          holding the predicted boxes.\n        detection_boxes_strided: A tensor of shape [batch_size, num_detections,\n          4] holding the predicted boxes in absolute coordinates of the\n          feature extractor\'s final layer output.\n        detection_scores: A tensor of shape [batch, max_detections] holding\n          the predicted score for each box.\n        detection_classes: An integer tensor of shape [batch, max_detections]\n          containing the detected class for each box.\n        num_detections: An integer tensor of shape [batch] containing the\n          number of detected boxes for each sample in the batch.\n        detection_keypoints: (Optional) A float tensor of shape [batch,\n          max_detections, num_keypoints, 2] with normalized keypoints. Any\n          invalid keypoints have their coordinates and scores set to 0.0.\n        detection_keypoint_scores: (Optional) A float tensor of shape [batch,\n          max_detection, num_keypoints] with scores for each keypoint.\n        detection_masks: (Optional) A uint8 tensor of shape [batch,\n          max_detections, mask_height, mask_width] with masks for each\n          detection. Background is specified with 0, and foreground is specified\n          with positive integers (1 for standard instance segmentation mask, and\n          1-indexed parts for DensePose task).\n        detection_surface_coords: (Optional) A float32 tensor of shape [batch,\n          max_detection, mask_height, mask_width, 2] with DensePose surface\n          coordinates, in (v, u) format.\n        detection_embeddings: (Optional) A float tensor of shape [batch,\n          max_detections, reid_embed_size] containing object embeddings.\n    '
    object_center_prob = tf.nn.sigmoid(prediction_dict[OBJECT_CENTER][(- 1)])
    (detection_scores, y_indices, x_indices, channel_indices) = top_k_feature_map_locations(object_center_prob, max_pool_kernel_size=3, k=self._center_params.max_box_predictions)
    (boxes_strided, classes, scores, num_detections) = prediction_tensors_to_boxes(detection_scores, y_indices, x_indices, channel_indices, prediction_dict[BOX_SCALE][(- 1)], prediction_dict[BOX_OFFSET][(- 1)])
    boxes = convert_strided_predictions_to_normalized_boxes(boxes_strided, self._stride, true_image_shapes)
    postprocess_dict = {fields.DetectionResultFields.detection_boxes: boxes, fields.DetectionResultFields.detection_scores: scores, fields.DetectionResultFields.detection_classes: classes, fields.DetectionResultFields.num_detections: num_detections, 'detection_boxes_strided': boxes_strided}
    if self._kp_params_dict:
        (keypoints, keypoint_scores) = self._postprocess_keypoints(prediction_dict, classes, y_indices, x_indices, boxes_strided, num_detections)
        (keypoints, keypoint_scores) = convert_strided_predictions_to_normalized_keypoints(keypoints, keypoint_scores, self._stride, true_image_shapes, clip_out_of_frame_keypoints=True)
        postprocess_dict.update({fields.DetectionResultFields.detection_keypoints: keypoints, fields.DetectionResultFields.detection_keypoint_scores: keypoint_scores})
    if self._mask_params:
        masks = tf.nn.sigmoid(prediction_dict[SEGMENTATION_HEATMAP][(- 1)])
        (densepose_part_heatmap, densepose_surface_coords) = (None, None)
        densepose_class_index = 0
        if self._densepose_params:
            densepose_part_heatmap = prediction_dict[DENSEPOSE_HEATMAP][(- 1)]
            densepose_surface_coords = prediction_dict[DENSEPOSE_REGRESSION][(- 1)]
            densepose_class_index = self._densepose_params.class_id
        (instance_masks, surface_coords) = convert_strided_predictions_to_instance_masks(boxes, classes, masks, true_image_shapes, densepose_part_heatmap, densepose_surface_coords, stride=self._stride, mask_height=self._mask_params.mask_height, mask_width=self._mask_params.mask_width, score_threshold=self._mask_params.score_threshold, densepose_class_index=densepose_class_index)
        postprocess_dict[fields.DetectionResultFields.detection_masks] = instance_masks
        if self._densepose_params:
            postprocess_dict[fields.DetectionResultFields.detection_surface_coords] = surface_coords
    if self._track_params:
        embeddings = self._postprocess_embeddings(prediction_dict, y_indices, x_indices)
        postprocess_dict.update({fields.DetectionResultFields.detection_embeddings: embeddings})
    if self._temporal_offset_params:
        offsets = prediction_tensors_to_temporal_offsets(y_indices, x_indices, prediction_dict[TEMPORAL_OFFSET][(- 1)])
        postprocess_dict[fields.DetectionResultFields.detection_offsets] = offsets
    return postprocess_dict