Traffic safety is an issue of particular concern to society, with an average of 30-35 fatalities daily, mainly on the roads. The main reason is the increasing number of vehicles, primarily personal vehicles. Research, survey, and statistically analyze the times and routes with high traffic, and propose warning tools to assist citizens, traffic police, and managers in reducing traffic congestion. Applying deep learning models to develop solutions and using Yolov8 for object detection. The dataset includes 1030 images divided into 2 folders: train (824 images) and test (206 images), which are images of various types of vehicles such as cars, motorcycles, trucks, buses, and bicycles. The experimental results show a recognition performance of 88.5%. This study proposes a vehicle detection and recognition model based on the yolov8 model, combined with statistical analysis of different types of vehicles. This is an accurate, easy, and cost-effective method for detecting vehicles.