Shortcuts

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.

参数
  • metrics (dict or BaseMetric or Sequence) – The config of metrics.

  • dataset_prefixes (Sequence[str]) – The prefix of each dataset. The length of this sequence should be the same as the length of the datasets.

返回类型

None

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.

返回类型

dict

Read the Docs v: dev-1.x
Versions
latest
stable
0.x
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.