All problems
FPN Level Assignment
Problem
Assign a region of interest to an FPN level from its size.
The standard rule is k = k0 + floor(log2(sqrt(h * w) / 224)), where 224 is the canonical image size. Return the integer level, or k0 when the region has non-positive dimensions.
Test cases
case 1
in: [224,224,4]
expected: 4
case 2
in: [112,112,4]
expected: 3
case 3
in: [448,448,4]
expected: 5
case 4
in: [100,400,3]
expected: 2
case 5
in: [32,32,4]
expected: 1
Starter codePython
def fpn_level(roi_h, roi_w, k0):
# Your code here
pass5 test cases · run your code against them in the editor