MultiDatasetsEvaluator¶
- class mmocr.evaluation.evaluator.MultiDatasetsEvaluator(metrics, dataset_prefixes)[source]¶
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.- Parameters
- Return type
- evaluate(size)[source]¶
Invoke
evaluate
method of each metric and collect the metrics dictionary.- Parameters
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.- Returns
Evaluation results of all metrics. The keys are the names of the metrics, and the values are corresponding results.
- Return type