Skip to content
DeepForgeby svx
All problems
MediumComputer Visioncv-233

Horizontal Flip TTA Average

Problem

Average a prediction map with its horizontally flipped TTA counterpart.

Return (prob[i][j] + prob_flipped[i][W - 1 - j]) / 2 per pixel, rounded to 4 decimal places.

Test cases

case 1
in: [[[0.2,0.8]],[[0.6,0.4]]]
expected: [[0.3,0.7]]
case 2
in: [[[1,0],[0,1]],[[0,1],[1,0]]]
expected: [[1,0],[0,1]]
case 3
in: [[[0.5,0.5],[0.5,0.5]],[[0.5,0.5],[0.5,0.5]]]
expected: [[0.5,0.5],[0.5,0.5]]
Starter codePython
def hflip_tta_average(prob, prob_flipped):
    # Your code here
    pass

3 test cases · run your code against them in the editor