| Algorithm 1: The pseudocode of K-means |
| 1: Given K cluster center points: , refer to the width and height of each anchor box. |
| 2: Calculate the distance between each ground truth and each cluster center: . Since the position of the anchor box is not fixed, the center point of each ground truth is coincident with the clustering center. |
| 3: Recalculate the cluster center for each cluster: |
| 4: Repeat step 2 and step 3 until the clusters converge. |