## 2 Materials and Methods
### You Only Look Once (YOLO)  
YOLO (You Only Loon Once) is a popular deep-learning technique utilized for two-dimensional object detection. It has the advantage of low-cost GPUs (Graphics Processing Units) and DNNs (Deep Neural Networks). The algorithm relies on a CNN (Convolutional Neural Network) and provides object detection in images and real-time videos. The architecture of YOLO is composed of three key components: the backbone, the neck, and the head. The backbone is responsible for extracting features from the input images, the neck processes these features, and the head supplies bounding boxes for object detection. The YOLO architecture is characterized by its simplicity, as it employs a single convolutional network to process the input image. The improved algorithm enables the detection of many objects within a single image. The algorithm separates every image into SxS grids, assigns them specific classes, and predicts and locates objects in a bounding box [10]. The first version of the algorithm was developed by [PERSON] et al. [9]. In recent years, several versions of YOLO have been released, with ongoing efforts focused on enhancing and advancing its capabilities. In comparison to its predecessors (versions 4, 5, and 6), YOLO version 7 (YOLOv7) stands out for its remarkable advancements. Notably, it achieves superior speed and accuracy. It outperforms all existing object detectors in terms of both speed and precision within 5 to 120 FPS (Frame Per Second) [39]. The model's enhanced resolution capacity contributes to its effectiveness in real-world scenarios. In this study, we utilized a real-time vehicle detection system that relies on the YOLOv7 framework, which was released in 2022. We evaluated the performance of the proposed strategy in comparison to the two variations of the YOLOv7 model, namely YOLOv7x and YOLOv7-tiny, on both the \"ISTraffic\" dataset and the COCO benchmark dataset. Table 2 displays the specifications of these models. The YOLOv7 model consists of 415 layers and has a total of 37,212,738 parameters, with a GFLOP (Giga-Floating-Point Operations per second) value of 105.2. YOLOv7x is an extended version of YOLOv7. It has a higher GFLOP value of 188.9, making it more powerful in terms of computation. It incorporates extra layers and parameters, rendering it well suited for tasks that require high accuracy. On the other hand, YOLOv7-tiny prioritizes speed and efficiency. It has a lower GFLOPs value of 13.2, which makes it an excellent choice for real-time applications on devices with limited resources. Three models were trained using two datasets: the \"ISTraffic\" dataset, which comprises 1125 images and 36,841 annotated instances, and the COCO benchmark dataset, which has 18,175 images and 68,634 annotations. To increase the performance of the algorithm, the number of image data used in the training has been increased by using image augmentation techniques including Contrast Limited Adaptive Histogram Equalization (CLAHE), Random Brightness Contrast, Random Gama, Blur, Median Blur, To Gray, and Image Compression with a probability of 0.01. In this study, the performance of YOLO was analyzed for both different environmental conditions and congested traffic. Two urban traffic surveillance video streams, each with a duration of five minutes, were captured at six-hour intervals on 25 November 2023 and used for comparing different environmental conditions. A total of eight distinct scenarios were recorded, each depicting different environments including normal traffic flow, congested traffic flow, rainy weather, and windy weather during daylight and night-time (Table 3). An hourly recording was used to determine the vehicle count during congested traffic conditions. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **Number of Layers** & **Number of Parameters** & **GFLOPs** \\ \hline YOLOv7 & 415 & 37,212,738 & 105.2 \\ YOLOv7x & 467 & 70,835,306 & 188.9 \\ YOLOv7-tiny & 263 & 6,023,106 & 13.2 \\ \hline \hline \end{tabular}
\end{table}