Looking at the source code in prior_box.py, we have code like pbox + = [cx, cy, ~, ~] in the forward function. If you analyze the loop with this code, pbox + = [cx, cy, scale, scale], pbox+=[cx, cy, scale_prime, scale_prime] are the parts that make the prior box size of scale and scale_prime when aspect ratio is 1.
for ar in self.aspect_ratios [k]:
pbox + = [cx, cy, scale sqrt (ar), scale / sqrt (ar)]
pbox + = [cx, cy, scale / sqrt (ar), scale sqrt (ar)]
This is where you create your pbox based on the aspect ratio you've specified.
The above is a simple look at pbox + = [cx, cy, w, h] and pbox + = [cx, cy, h, w].
In other words, you can think of reversing the axis of the aspect ratio (flip aspect ratios).
The difference between [[2]] and [[2,3]] is related to the number of prior boxes to be predicted in each feature map layer.
When I just want to set the aspect ratio to 1, how do I set
‘aspect ratio:’
? I tried'aspect ratio:[]'
, but this will give an error.