# EnsembleVehicleDet: Detection of Faraway Vehicles with Real-Time Consideration
## 3 Proposed Method
### Obtaining Detection Results from Transformed Image
Upsampling1_Frame = Upsampling1_Transform(Frame, RoIImage) // Box list for the present Upsampling1_Frame from Model B Detections_B_U_1 = GetBoxList(Upsampling1_Frame, Model_B) // The box information detected through image conversion is readjusted to match the original image. Re-coordinate_Detections = Upsampling1 Re-adjustment(Detections_B_U_1, Frame) return Re-coordinate_Detections = Upsampling2 Re-adjustment(Detections_B_U_2, Frame) return Re-coordinate_Detections
```  
**Algorithm 9** Re-coordinate_Detections  
```
Input: Frame = Pixel information for the current frame from the video Model B = Network Modified Model B = Network Modified Model Warping_Coordinates = Two coordinates on the image to apply Perspective Transformation on: [y1, y2] Checking the pre-processing method = 0(upsampling#1 or upsampling#2), 1(warping) RollImage = Pixel information for RoI region through AccumulateImage_S from the original image Output: Re-coordinate_Detections = Box list readjusted from Model B = Perspect_Mat // 3 \(\times\) 3 array used when warp transforming, saved only once in the first frame. if Checking the pre-processing method = 0 then // Image transformation is performed using the RoI image obtained from

### Merging Detection Results from First and Second Detectors

Finally, the detection results of Model B for the post-processed image obtained through Algorithm 2 and the detection results of Model A should be merged. The Intersection over Union (IoU) is not suitable for checking the accuracy of the detection results since it measures only the degree of overlap; thus, the Distance Intersection over Union (DIoU), which considers the center coordinates of the detection results, is used. In the proposed method, if the detection results of each detector are higher than 0.2, then based on the confidence score, only the detection results with a higher confidence score are left, and the other results are removed. The RoI obtained from Algorithm 1 is the configured region, where the possibility of small vehicles being present is high. Therefore, by increasing the confidence score of the results detected within the RoI region of the second detector, the priority is given to the second detector Model B over the first detector Model A. Algorithm 3 shows the pseudo-code for the merging phase. ```
Input: Frame = Pixel information for the current frame from the video Original_Detections = Box list for the current frame from Model A Re-coordinate_Detections = Box list readjusted from Model B to the original image DIoU_Thresh = Variables to determine the degree to which DIoU overlaps the detection results of both models Output: Final_Detections = Final detection results for the current frame //sort first_box and second_box in descending order of confidence value Sort_Descending(Original_Detections) Sort_Descending(Re-coordinate_Detections) matched_boxes = 0 for i = 0 to size of Re-coordinate_Detections do  for j = 0 to size of Original_Detections do  max_DIoU = largest DIoU of Re-coordinate_Detections[i] and Original_Detections[j]  if max_DIoU > DIoU_Thresh do  Final_Detections[matched_boxes] = Re-coordinate_Detections[i]  Final_Detections[matched_boxes].confidence = Re-coordinate_Detections[i].confidence  Original_Detections[j].confidence  matched_boxes++  Original_Detections[j] = 0 for j = 0 to size of Original_Detections do  if Original_Detections[j] = 0 then continue  Final_Detections[matched_boxes] = Original_Detections[j]  matched_boxes++ return Final_Detections
```

**Algorithm 3** Merging Detection Results

## 4 Experimental Results

### Experimental Setup

In this study, cars, trucks, and buses of various (total of 8) classes were set as the target objects in autonomous driving competitions conducted using Argoverse data. All Argoverse data were collected using the same car (i.e., a Ford Fusion Hybrid) fully integrated with Argo AI power generation technology. Annotations are automatically generated throughout an entire tracking sequence.