Shortcuts

mmedit.evaluation.metrics.matting_mse

Module Contents

Classes

MattingMSE

Mean Squared Error metric for image matting.

class mmedit.evaluation.metrics.matting_mse.MattingMSE(norm_const=1000, **kwargs)[source]

Bases: mmengine.evaluator.BaseMetric

Mean Squared Error metric for image matting.

This metric compute per-pixel squared error average across all pixels. i.e. mean((a-b)^2) / norm_const

Note

Current implementation assume image / alpha / trimap array in numpy format and with pixel value ranging from 0 to 255.

Note

pred_alpha should be masked by trimap before passing into this metric

Default prefix: ‘’

Parameters

norm_const (int) – Divide the result to reduce its magnitude. Default to 1000.

Metrics:
  • MattingMSE (float): Mean of Squared Error

default_prefix =[source]
process(data_batch: Sequence[dict], data_samples: Sequence[dict]) None[source]

Process one batch of data and predictions.

Parameters
  • data_batch (Sequence[dict]) – A batch of data from the dataloader.

  • data_samples (Sequence[dict]) – A batch of outputs from the model.

compute_metrics(results: List)[source]

Compute the metrics from processed results.

Parameters

results (dict) – The processed results of each batch.

Returns

The computed metrics. The keys are the names of the metrics, and the values are corresponding results.

Return type

Dict

Read the Docs v: latest
Versions
master
latest
stable
zyh-re-docs
zyh-doc-notfound-extend
zyh-api-rendering
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.