Shortcuts

Evaluator

class mmengine.evaluator.Evaluator(metrics)[源代码]

Wrapper class to compose multiple BaseMetric instances.

参数:

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

property dataset_meta: dict | None

Meta info of the dataset.

Type:

Optional[dict]

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

offline_evaluate(data_samples, data=None, chunk_size=1)[源代码]

Offline evaluate the dumped predictions on the given data .

参数:
  • data_samples (Sequence) – All predictions and ground truth of the model and the validation set.

  • data (Sequence, optional) – All data of the validation set.

  • chunk_size (int) – The number of data samples and predictions to be processed in a batch.

process(data_samples, data_batch=None)[源代码]

Convert BaseDataSample to dict and invoke process method of each metric.

参数:
  • data_samples (Sequence[BaseDataElement]) – predictions of the model, and the ground truth of the validation set.

  • data_batch (Any, optional) – A batch of data from the dataloader.

Read the Docs v: latest
Versions
latest
stable
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.1
v0.9.0
v0.8.5
v0.8.4
v0.8.3
v0.8.2
v0.8.1
v0.8.0
v0.7.4
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.0
v0.2.0
Downloads
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.