 This paper proposes an improved algorithm based on the YOLOV-7, a tiny model to detect vehicles in drone images. It uses aspect ratio to assign anchor boxes which provides prior information about the shape of the vehicle, as well as a heart sample mining loss function to identify heart samples and improve performance. The algorithm was tested on a drone image dataset and compared against other state of dart algorithms. Results showed that the proposed algorithm outperformed all other algorithms in terms of average precision. Additionally, the algorithm had a lighter weight than other algorithms, making it suitable for real-time applications. This article was authored by Shoming Hu, Fei Zhao, Huan Zheng Lu, and others.