MultiDatasetsEvaluator¶
- class mmocr.evaluation.evaluator.MultiDatasetsEvaluator(metrics, dataset_prefixes)[源代码]¶
Wrapper class to compose class: ConcatDataset and multiple
BaseMetric
instances. The metrics will be evaluated on each dataset slice separately. The name of the each metric is the concatenation of the dataset prefix, the metric prefix and the key of metric - e.g. dataset_prefix/metric_prefix/accuracy.- 参数
- 返回类型
- evaluate(size)[源代码]¶
Invoke
evaluate
method of each metric and collect the metrics dictionary.- 参数
size (int) – Length of the entire validation dataset. When batch size > 1, the dataloader may pad some data samples to make sure all ranks have the same length of dataset slice. The
collect_results
function will drop the padded data based on this size.- 返回
Evaluation results of all metrics. The keys are the names of the metrics, and the values are corresponding results.
- 返回类型