mmagic.evaluation.metrics.connectivity_error
¶
Evaluation metrics used in Image Matting.
Module Contents¶
Classes¶
Connectivity error for evaluating alpha matte prediction. |
- class mmagic.evaluation.metrics.connectivity_error.ConnectivityError(step=0.1, norm_constant=1000, **kwargs)[source]¶
Bases:
mmagic.evaluation.metrics.base_sample_wise_metric.BaseSampleWiseMetric
Connectivity error for evaluating alpha matte prediction.
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
- Parameters
step (float) – Step of threshold when computing intersection between alpha and pred_alpha. Default to 0.1 .
norm_const (int) – Divide the result to reduce its magnitude. Default to 1000.
Default prefix: ‘’
- Metrics:
ConnectivityError (float): Connectivity Error
- process(data_batch: Sequence[dict], data_samples: Sequence[dict]) None [source]¶
Process one batch of data samples and predictions. The processed results should be stored in
self.results
, which will be used to compute the metrics when all batches have been processed.- Parameters
data_batch (Sequence[dict]) – A batch of data from the dataloader.
predictions (Sequence[dict]) – A batch of outputs from the model.