Shortcuts

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
  • 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.

Return type

None

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

dict

Read the Docs v: dev-1.x
Versions
latest
stable
v1.0.1
v1.0.0
0.x
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
v0.4.1
v0.4.0
v0.3.0
v0.2.1
v0.2.0
v0.1.0
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.