ssd.pytorch icon indicating copy to clipboard operation
ssd.pytorch copied to clipboard

How to set 'aspect ratio == 1' only?

Open decoli opened this issue 4 years ago • 1 comments

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.

Originally posted by @RyuJunHwan in https://github.com/amdegroot/ssd.pytorch/issues/192#issuecomment-401987940

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.

decoli avatar Jun 25 '20 14:06 decoli

aspect raito=1 > creates a square anchor aspect raito=0.5 >standing anchor aspect raito =2 >landscape anchor fonte: https://github.com/yehengchen/Object-Detection-and-Tracking/tree/master/OneStage/ssd

eltonfernando avatar Nov 04 '21 12:11 eltonfernando