Region Proposal Network Question

Good day guys,

I did read about RPN and looked at the source code and found these 2 fnc that I didn’t understand, what purpose do they serve? And why we should ever consider using them? Another question is that batch_size_per_image; is it meant to be the number of the anchors used on the image or the batch size of my data?

        batch_size_per_image (int): number of anchors that are sampled during training of the RPN
                    for computing the loss
        pre_nms_top_n (Dict[str, int]): number of proposals to keep before applying NMS. It should
            contain two fields: training and testing, to allow for different values depending
            on training or evaluation
        post_nms_top_n (Dict[str, int]): number of proposals to keep after applying NMS. It should
            contain two fields: training and testing, to allow for different values depending
            on training or evaluation

I appreciate your time. Thanks!