All problems
Anchor Count per Level
Problem
Count the anchors each feature level of a detector produces.
A level with an h x w map and anchors_per_cell anchors per location contributes h * w * anchors_per_cell anchors. Return the list of counts in the same order as feature_sizes.
Test cases
case 1
in: [[[38,38],[19,19],[10,10],[5,5],[3,3],[1,1]],6]
expected: [8664,2166,600,150,54,6]
case 2
in: [[[2,3],[1,1]],4]
expected: [24,4]
case 3
in: [[[4,4]],2]
expected: [32]
Starter codePython
def anchor_counts_per_level(feature_sizes, anchors_per_cell):
# Your code here
pass3 test cases · run your code against them in the editor