mmagic.evaluation.metrics.sad
¶
Module Contents¶
Classes¶
Sum of Absolute Differences metric for image matting. |
- class mmagic.evaluation.metrics.sad.SAD(norm_const=1000, **kwargs)[source]¶
Bases:
mmagic.evaluation.metrics.base_sample_wise_metric.BaseSampleWiseMetric
Sum of Absolute Differences metric for image matting.
This metric compute per-pixel absolute difference and sum across all pixels. i.e. sum(abs(a-b)) / 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:
SAD (float): Sum of Absolute Differences