In the practical application of vehicle detection, the biggest problem to be solved is the lightweight problem of the application, and the lightweight application can better reduce the application cost and application scenarios. Therefore, more and more scientific research projects pay more attention to improving the efficiency and accuracy of target detection, so that the model can complete lightweight application. In this paper, Transformer architecture based on YOLOv5 model combined with EfficientFormerV2 is proposed to improve the accuracy and efficiency of YOLOv5 in vehicle detection tasks, and more lightweight applications are generated based on this. In applications, the combination of EfficientFormerV2 and YOLOv5 reduces the size and computational effort of the model, making it suitable for smaller devices and low-power applications. This combination can also improve the robustness and generalization ability of the model, making it more suitable for practical application scenarios.