PyRetri/pyretri/evaluate/evaluator/evaluators_base.py
2020-04-15 14:44:22 +08:00

22 lines
473 B
Python

# -*- coding: utf-8 -*-
from abc import abstractmethod
from ...utils import ModuleBase
from typing import Dict
class EvaluatorBase(ModuleBase):
"""
The base class of evaluators which compute mAP and recall.
"""
default_hyper_params = {}
def __init__(self, hps: Dict or None = None):
super(EvaluatorBase, self).__init__(hps)
@abstractmethod
def __call__(self, query_result: Dict, gallery_info: Dict) -> (float, Dict):
pass