def merge_internal_state(self, image_ids, state_tuple):
    """Merges internal state with the existing state of evaluation.

    If image_id is already seen by evaluator, an error will be thrown.

    Args:
      image_ids: list of images whose state is stored in the tuple.
      state_tuple: state.
    """
    for image_id in image_ids:
      if image_id in self._image_ids:
        raise ValueError('Image with id {} already added.'.format(image_id))

    self._evaluation.merge_internal_state(state_tuple)
Merges internal state with the existing state of evaluation.

    If image_id is already seen by evaluator, an error will be thrown.

    Args:
      image_ids: list of images whose state is stored in the tuple.
      state_tuple: state.
    
inference_api/src/main/object_detection/utils/object_detection_evaluation.py