All problems
Five-Crop TTA Indices
Problem
Return the top-left corners of the five standard test-time-augmentation crops.
The order is top-left, top-right, bottom-left, bottom-right, then center, using integer division for the center offsets. The crop is assumed to fit inside the image.
Test cases
case 1
in: [4,6,2,2]
expected: [[0,0],[0,4],[2,0],[2,4],[1,2]]
case 2
in: [5,5,3,3]
expected: [[0,0],[0,2],[2,0],[2,2],[1,1]]
case 3
in: [2,3,2,3]
expected: [[0,0],[0,0],[0,0],[0,0],[0,0]]
Starter codePython
def five_crop_indices(h, w, crop_h, crop_w):
# Your code here
pass3 test cases · run your code against them in the editor