def evaluator_options_from_eval_config(eval_config):
    """Produces a dictionary of evaluation options for each eval metric.

  Args:
    eval_config: An `eval_pb2.EvalConfig`.

  Returns:
    evaluator_options: A dictionary of metric names (see
      EVAL_METRICS_CLASS_DICT) to `DetectionEvaluator` initialization
      keyword arguments. For example:
      evalator_options = {
        'coco_detection_metrics': {'include_metrics_per_category': True}
      }
  """
    eval_metric_fn_keys = eval_config.metrics_set
    evaluator_options = {}
    for eval_metric_fn_key in eval_metric_fn_keys:
        if eval_metric_fn_key in ('coco_detection_metrics', 'coco_mask_metrics'
            ):
            evaluator_options[eval_metric_fn_key] = {
                'include_metrics_per_category': eval_config.
                include_metrics_per_category}
        elif eval_metric_fn_key == 'precision_at_recall_detection_metrics':
            evaluator_options[eval_metric_fn_key] = {'recall_lower_bound':
                eval_config.recall_lower_bound, 'recall_upper_bound':
                eval_config.recall_upper_bound}
    return evaluator_options
