To solve the problems of a large number of parameters, low detection accuracy, slow detection speed of human flow target detection model, this paper proposes a YOLOv5 human flow target detection model based on GhostNetv2. The convolution in the first layer of CBS is retained to replace the remaining convolutions with Ghost Conv, and the C3Ghostv2 module is constructed to replace the original CSP structure, reducing the number of parameters, reducing the calculation cost and improving the calculation speed. Finally, the Deep-Sort algorithm tracks and realizes real-time statistics of people flow. The experimental results indicate that the accuracy of the improved YOLOv5 model is 2.4 percentage points higher than that of the original algorithm, the parameter quantity is compressed by 28 %, and the detection speed has also increased.