Closed jingting9 closed 3 years ago
self.scales
is xyscale.
If input_size is 416 * 416
, because strides are 8, 16, and 32, the sizes of the predicted grids are 52 * 52
, 26 * 26
and 13 * 13
.
There are 3 anchors in each grid, in order [[12, 16], [19, 36], [40, 28]]
, [[36, 75], [76, 55], [72, 146]]
, [[142, 110], [192, 243], [459, 401]]
.
The small size of the anchor means that small objects are detected.
Small size objects are detected in the 52*52 size grid.
Suppose a small object center is (240.4, 240.4) in a 416 * 416 size image when xyscale is not used.
When the object is detected, txty_s is (0.05, 0.05)
and coordinate is (30, 30)
, bxby_s is ((30 + 0.05) / 52, (30 + 0.05) / 52)
.
But if it uses xyscale.
the object is detected at 4 points. (29, 29) + (0.9583, 0.9583)
, (29, 30) + (0.9583, 0.125)
, (30, 29) + (0.125, 0.9583)
, (30, 30) + (0.125, 0.125)
29 + (0.9583 - 0.5) * 1.2 + 0.5 == 30 + (0.125 - 0.5) * 1.2 + 0.5 == 30.05
Because AI is probability, an object near an edge can be found on both sides of the edge. I think using xyscale improves the inference a little more at the corners.
Thank you for your reply! I sort of understand what you mean. Still don't know how xyscale came from. Is it set by yourself or computed by some methods?
Thank you for your patient :)
Hi, I have two questions about "txty_s = (txty_s - self.a_half[0]) * self.scales[0] + self.a_half[0]" in head.py