Recent years have seen advances in deep learning, including in the field of traffic management. Detecting distant objects that occupy a small number of pixels in the input image is one of the major challenges in computer vision for several reasons, including limited resolution. The challenges of detecting the rotation of objects may be attributed to the deflection of the camera when taking photographs. We recommend enhancing the features of the YOLOv5 network. The proposed method is to train a model on a traffic dataset, which achieves the best inference results through training, testing, and detection on a 1280 × 1280 image for 300 epochs. Moreover, modifications were made to some structural elements of the YOLOv5. In addition to detecting round objects by increasing degrees from 0 to 270, it also increases the probability of flipping in all directions: up, down, left, and right. In addition, the degree of rotation of the image was increased to 90 degrees. The results showed optimized accuracy in detecting distant and small objects, as 73 objects were detected compared to the original YOLOv5 23 objects. It achieved the best number of objects detected in the video (people, cars, and others), and detecting rotating objects increases the number of detected objects (32 objects). The inference time was (23 Ms.) this dataset can make excellent traffic monitoring applications. This model can be deployed on an Android mobile device to provide accurate data about current traffic at a specific location. This is because a mobile device can be used at any time and place. Therefore, in the future, we are working on designing models for object detection that can be operated on mobile devices.