Real-time people counting based on videos is one of the most popular projects in the construction of smart cities. To develop an accurate people counting approach, deep learning can be used as it greatly improves the accuracy of machine learning-based approaches. To this end, we have previously proposed an accurate you only look once (YOLO)-based people counting approach, dubbed YOLO-PC. However, the model of YOLO-PC was very large with an excessive number of parameters, thus it requires large storage space on the device and makes transmission on internet a time consuming task. In this paper, a new real-time people counting method named as squeeze YOLO-based people counting (S-YOLO-PC) is proposed. S-YOLO-PC uses the fire layer of SqueezeNet to optimise the network structure, which reduces the number of parameters used in the model without decreasing its accuracy. Based on the obtained the experimental results, S-YOLO-PC reduces the number of model parameters by 11.5% and 9% compared to YOLO and YOLO-PC, respectively. S-YOLO-PC can also detect and count people with 41 frames per second (FPS) with the average precision (AP) of person of 72%.