Fine-Tuning Object Detection Models
Detectron2 utilizes the concepts of anchors to improve its object detection accuracy by allowing object detection models to predict from a set of anchors instead of from scratch. The set of anchors has various sizes and ratios to reflect the shapes of the objects to be detected. Detectron2 uses two sets of hyperparameters called sizes and ratios to generate the initial set of anchors. Therefore, this chapter explains how Detectron2 processes its inputs and provides code to analyze the ground-truth boxes from a training dataset and find appropriate values for these anchor sizes and ratios.
Additionally, input image pixels’ means and standard deviations are crucial in training Detectron2 models. Specifically, Detectron2 uses these values to normalize the input images during training. Calculating these hyperparameters over the whole dataset at once is often impossible for large datasets. Therefore, this chapter provides the code to calculate...