All problems
Pixel Accuracy
Problem
Compute pixel accuracy between two same-shaped label maps.
Return the fraction of pixels that are equal, rounded to 4 decimal places. The maps are non-empty.
Test cases
case 1
in: [[[1,2],[3,4]],[[1,0],[3,4]]]
expected: 0.75
case 2
in: [[[1,2],[3,4]],[[1,2],[3,4]]]
expected: 1
case 3
in: [[[0,0],[0,0]],[[1,1],[1,1]]]
expected: 0
Starter codePython
def pixel_accuracy(pred, target):
# Your code here
pass3 test cases · run your code against them in the editor