Skip to content
EvalSuite
Documentation menu

Segmentation

Pixel accuracy

Implementedsegmentation.pixel_accuracy

Definition

Fraction of correctly labelled pixels.

Formula

PA = Σₖ nₖₖ / Σₖ tₖ

Range: [0, 1]

Inputs and outputs

  • y_true: ground-truth mask (H×W or N×H×W)
  • y_pred: predicted mask with the same shape

Returns: float

Assumptions

No assumptions beyond valid, aligned inputs of the documented types.

Limitations

  • Dominated by large classes such as background.

Python API

PythonSince v0.3.0
import evalsuite as es

es.pixel_accuracy(y_true, y_pred, ignore_index=255)
es.mean_pixel_accuracy(y_true, y_pred)

References

  1. Long, J., Shelhamer, E., & Darrell, T. (2015). Fully convolutional networks for semantic segmentation. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 3431–3440.

Implementation status