Change the required parameters in faster rcnn spec file

Hi.
Do I need to change the

image_channel_mean

and

anchor_box_config

in faster rcnn spec file based on my dataset?

Image_channel_mean is the part of preprocessing. It is not needed to change.

For your own dataset, you can modify anchor_box_config to get new anchor sizes if needed.

For example,
case1:
anchor_box_config {
scale: 8.0
scale: 16.0
scale: 32.0
ratio: 1.0
ratio: 0.5
ratio: 2.0
}

The anchor will be

array([[[ 8.      ,  8.      ],
        [ 5.656854, 11.313708],
        [11.313708,  5.656854]],

       [[16.      , 16.      ],
        [11.313708, 22.627417],
        [22.627417, 11.313708]],

       [[32.      , 32.      ],
        [22.627417, 45.254833],
        [45.254833, 22.627417]]], dtype=float32)

because
8*sqrt(1)= 8
8*sqrt(0.5)= 5.656854
8*sqrt(2)  = 11.313708
16*sqrt(1)= 16
16*sqrt(0.5)= 11.313708
16*sqrt(2)  = 22.627417
32*sqrt(1)= 32
32*sqrt(0.5)= 22.627417
32*sqrt(2)  = 45.254833

case2:
anchor_box_config {
scale: 4.0
scale: 4.6
scale: 5.0
ratio: 1.0
ratio: 0.5
ratio: 2.0
}

It can cover anchor sizes like
4x4,
2.828x5.656
5.656x2.828
4.6x4.6
3.25x6.5
6.5x3.25
5x5
3.535x7.07
7.07x3.535

1 Like

Thank you.
How do I know what scale to use for my dataset?

TLT did not provide a tool to set exact scale/ratio.
You can calculate the resolution of the bboxes in your label files.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.