A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | This was something I put together when I was trying to understand a few things that were not clear to me after reading RetinaNet paper. Some of the questions I had was: - Why there was (x, y) coordinates that were negative or too big to fit in the oiginal image? - Why is the upper left anchor box does not start with (0, 0)? - What would anchorboxes look like when the image is not square? - When they say "scales", are they talking about the scale of the area or the edge length? Here is what the coordinates looks like for the activations of P7 when your original image size is height 428 and width 640. As you can see, it has 3 aspect ratios and 3 scales (making it k=9). "Anchor Area" for P7 is set as 512 by 512 in the paper. I used these numbers to make sure that the I can explain coordinates of the anchor boxes are what I expect. Here is some visualization: https://gist.github.com/anonymous/a9abce58edcd20d29d4a8180ac40132a","https://gist.github.com/anonymous/a9abce58edcd20d29d4a8180ac40132a | |||||||||||||||||||||||
2 | ||||||||||||||||||||||||
3 | Anchor ctr_x, ctr_y with respect to feature map (P7) | Anchor ctr_x, ctr_y with respect to the original image | Aspect Ratios (w:h) | Area for P7 | Scales | |||||||||||||||||||
4 | width | height | scale (1/128) | width | height | actual w scale | actual h scale | 1:2 | 1:1 | 2:1 | 512*512 | 2^0 | 2^1/3 | 2^2/3 | ||||||||||
5 | 5 | 4 | 0.0078125 | 640 | 428 | 128 | 107 | 0.5 | 1 | 2 | 262144 | 1 | 1.25992105 | 1.587401052 | ||||||||||
6 | ||||||||||||||||||||||||
7 | x | 0.5 | 1.5 | 2.5 | 3.5 | 4.5 | 64 | 192 | 320 | 448 | 576 | Aspect Ratios | ||||||||||||
8 | y | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 53.5 | 53.5 | 53.5 | 53.5 | 53.5 | 1:2 | 1:1 | 2:1 | ||||||||||
9 | 0.5 | 1.5 | 2.5 | 3.5 | 4.5 | 64 | 192 | 320 | 448 | 576 | Scales | 2^0 [w] | 362.038672 | 512 | 724.0773439 | |||||||||
10 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 160.5 | 160.5 | 160.5 | 160.5 | 160.5 | 2^0 [h] | 724.0773439 | 512 | 362.038672 | ||||||||||
11 | 0.5 | 1.5 | 2.5 | 3.5 | 4.5 | 64 | 192 | 320 | 448 | 576 | 2^1/3 [w] | 456.1401437 | 645.0795775 | 912.2802874 | ||||||||||
12 | 2.5 | 2.5 | 2.5 | 2.5 | 2.5 | 267.5 | 267.5 | 267.5 | 267.5 | 267.5 | 2^1/3 [h] | 912.2802874 | 645.0795775 | 456.1401437 | ||||||||||
13 | 0.5 | 1.5 | 2.5 | 3.5 | 4.5 | 64 | 192 | 320 | 448 | 576 | 2^2/3 [w] | 574.7005687 | 812.7493386 | 1149.401137 | ||||||||||
14 | 3.5 | 3.5 | 3.5 | 3.5 | 3.5 | 374.5 | 374.5 | 374.5 | 374.5 | 374.5 | 2^2/3 [h] | 1149.401137 | 812.7493386 | 574.7005687 | ||||||||||
15 | ||||||||||||||||||||||||
16 | Anchors | |||||||||||||||||||||||
17 | All center x, center y combinations in feature map P7 | anchor_wh | ||||||||||||||||||||||
18 | center x | center y | width | height | ||||||||||||||||||||
19 | 64 | 53.5 | 362.038672 | 724.0773439 | Visualization: | https://gist.github.com/anonymous/a9abce58edcd20d29d4a8180ac40132a | ||||||||||||||||||
20 | 64 | 160.5 | 456.1401437 | 912.2802874 | center x | center y | width | height | xmin | ymin | xmax | ymax | ||||||||||||
21 | 64 | 267.5 | 574.7005687 | 1149.401137 | 64 | 53.5 | 362.038672 | 724.0773439 | -117.019336 | -308.538672 | 245.019336 | 415.538672 | ||||||||||||
22 | 64 | 374.5 | 512 | 512 | 64 | 53.5 | 456.1401437 | 912.2802874 | -164.0700718 | -402.6401437 | 292.0700718 | 509.6401437 | ||||||||||||
23 | 192 | 53.5 | 645.0795775 | 645.0795775 | 64 | 53.5 | 574.7005687 | 1149.401137 | -223.3502844 | -521.2005687 | 351.3502844 | 628.2005687 | ||||||||||||
24 | 192 | 160.5 | 812.7493386 | 812.7493386 | 64 | 53.5 | 512 | 512 | -192 | -202.5 | 320 | 309.5 | ||||||||||||
25 | 192 | 267.5 | 724.0773439 | 362.038672 | 64 | 53.5 | 645.0795775 | 645.0795775 | -258.5397888 | -269.0397888 | 386.5397888 | 376.0397888 | ||||||||||||
26 | 192 | 374.5 | 912.2802874 | 456.1401437 | 64 | 53.5 | 812.7493386 | 812.7493386 | -342.3746693 | -352.8746693 | 470.3746693 | 459.8746693 | ||||||||||||
27 | 320 | 53.5 | 1149.401137 | 574.7005687 | 64 | 53.5 | 724.0773439 | 362.038672 | -298.038672 | -127.519336 | 426.038672 | 234.519336 | ||||||||||||
28 | 320 | 160.5 | 64 | 53.5 | 912.2802874 | 456.1401437 | -392.1401437 | -174.5700718 | 520.1401437 | 281.5700718 | ||||||||||||||
29 | 320 | 267.5 | 64 | 53.5 | 1149.401137 | 574.7005687 | -510.7005687 | -233.8502844 | 638.7005687 | 340.8502844 | ||||||||||||||
30 | 320 | 374.5 | ||||||||||||||||||||||
31 | 448 | 53.5 | ||||||||||||||||||||||
32 | 448 | 160.5 | ||||||||||||||||||||||
33 | 448 | 267.5 | ||||||||||||||||||||||
34 | 448 | 374.5 | ||||||||||||||||||||||
35 | 576 | 53.5 | ||||||||||||||||||||||
36 | 576 | 160.5 | ||||||||||||||||||||||
37 | 576 | 267.5 | ||||||||||||||||||||||
38 | 576 | 374.5 | ||||||||||||||||||||||
39 | ||||||||||||||||||||||||
40 | ||||||||||||||||||||||||
41 | ||||||||||||||||||||||||
42 | ||||||||||||||||||||||||
43 | ||||||||||||||||||||||||
44 | ||||||||||||||||||||||||
45 | ||||||||||||||||||||||||
46 | ||||||||||||||||||||||||
47 | ||||||||||||||||||||||||
48 | ||||||||||||||||||||||||
49 | ||||||||||||||||||||||||
50 | ||||||||||||||||||||||||
51 | ||||||||||||||||||||||||
52 | ||||||||||||||||||||||||
53 | ||||||||||||||||||||||||
54 | ||||||||||||||||||||||||
55 | ||||||||||||||||||||||||
56 | ||||||||||||||||||||||||
57 | ||||||||||||||||||||||||
58 | ||||||||||||||||||||||||
59 | ||||||||||||||||||||||||
60 | ||||||||||||||||||||||||
61 | ||||||||||||||||||||||||
62 | ||||||||||||||||||||||||
63 | ||||||||||||||||||||||||
64 | ||||||||||||||||||||||||
65 | ||||||||||||||||||||||||
66 | ||||||||||||||||||||||||
67 | ||||||||||||||||||||||||
68 | ||||||||||||||||||||||||
69 | ||||||||||||||||||||||||
70 | ||||||||||||||||||||||||
71 | ||||||||||||||||||||||||
72 | ||||||||||||||||||||||||
73 | ||||||||||||||||||||||||
74 | ||||||||||||||||||||||||
75 | ||||||||||||||||||||||||
76 | ||||||||||||||||||||||||
77 | ||||||||||||||||||||||||
78 | ||||||||||||||||||||||||
79 | ||||||||||||||||||||||||
80 | ||||||||||||||||||||||||
81 | ||||||||||||||||||||||||
82 | ||||||||||||||||||||||||
83 | ||||||||||||||||||||||||
84 | ||||||||||||||||||||||||
85 | ||||||||||||||||||||||||
86 | ||||||||||||||||||||||||
87 | ||||||||||||||||||||||||
88 | ||||||||||||||||||||||||
89 | ||||||||||||||||||||||||
90 | ||||||||||||||||||||||||
91 | ||||||||||||||||||||||||
92 | ||||||||||||||||||||||||
93 | ||||||||||||||||||||||||
94 | ||||||||||||||||||||||||
95 | ||||||||||||||||||||||||
96 | ||||||||||||||||||||||||
97 | ||||||||||||||||||||||||
98 | ||||||||||||||||||||||||
99 | ||||||||||||||||||||||||
100 |