# Non-Maximum Suppression Performs Later in Multi-Object Tracking
## 3 Materials and Methods
### Performing NMS Later
#### 3.1.1 NMS Performs in Tracking  
This paper removes the NMS in the detection; therefore, all detection boxes obtained by tracking are used as detection results for tracking. In the tracking stage, after using a Kalman filter to predict the target position, NMS processing is performed according to the IOU value of the calculated prediction result and the real frame. The detection boxes below the Intersection over Union (IoU) threshold will be filtered out, leaving several detection boxes that are close to the predicted box in position, and the ground-truth boxes with the highest confidence are further screened out as the candidate boxes. The workflow of NMS performs in tracking is shown in Figure 2.  
Figure 1: Workflow of our method: Given the video frame (**1**), the picture in the first line is the previous frame of the video, and the picture in the second line is the result of YOLOX detection. The tracking result of the previous frame and the image of this frame are predicted by the Kalman filter and matched with the detection result through IOU (**2**). For the high-scoring boxes in the detection boxes, after extracting its features, calculate the affinity with trajectories of the previous frame, and then match with each track (**3**); For boxes with lower scores, feature extraction is performed on the image after bicubic interpolation, and the affinity with the unmatched trajectories is calculated and then matched (**4**). Finally, the tracked result (**5**) is obtained. Figure 2: Workflow of NMS performing in tracking and previous work: The first column of pictures on the left is the detection result \(a\) without NMS performed. The first row of pictures on the right is previous work, the first column of pictures is the gt boxes after performing NMS on \(a\), the white box of the second column of pictures is the target position predicted by Kalman filtering, and the third column of pictures is the result of IOU calculation of gt boxes and predictions. The second row of pictures is our method, the first column of pictures is the target position predicted by Kalman filtering, and the second column of pictures is the result of the detection result and the predicted NMS according to the IOU. The third column of pictures is the result of further taking the box with higher confidence as the prediction result. When a person of interest appears in a frame for the first time, all detection boxes will be retained in the detection stage. In the tracking stage, these detection boxes calculate IOU according to the position predicted by a Kalman filter. The detection box with IOU higher than the threshold will be used as the candidate box, and the ReID model will be used to judge whether it is an existing target. If it is not an existing target, it will filter out the error detection boxes through NMS together with all detection boxes. After NMS, the detection box that is neither an existing target nor an unfiltered one will be regarded as a new target and assigned a new ID. Input the video frame into the detection algorithm and obtain a series of detection boxes \(B_{t}=\{B_{t}^{1},B_{t}^{2},B_{t}^{3},\ldots,B_{t}^{n}\}\). Among them, \(B_{t}^{n}(x_{1},y_{1},x_{2},y_{2})\) represents the \(i\)th detection frame of the \(t\) frame, and the predicted target position is \(P(x_{1}^{\prime},y_{1}^{\prime},x_{2}^{\prime},y_{2}^{\prime})\). The IOU value \(c_{i}\) of each detection box and predicted position can be calculated according to the coordinates of the detection box and the predicted position. \(c_{i}\) can be formulated as:  
\[c_{i}=\frac{Intersection(B_{t}^{i},P)}{Union(B_{t}^{i},P)} \tag{1}\]  
\[\hat{B_{t}}=\{B_{t}^{i}\in B_{t}|c_{i}>\theta\} \tag{2}\]  
As (2), according to the calculated IOU value \(c_{i}\) of each detection box and predicted position, the box whose IOU value is less than the IOU threshold \(\theta\) is filtered out, and the boxes \(\hat{B_{t}}\) that are closer to the predicted position are obtained.