This paper introduces research aimed at developing and implementing an intelligent passenger counting system in public transportation. The goal is to enhance fare evasion control and reduce financial losses for transit operators by automatically monitoring the entering and exiting of passengers. Utilizing the advanced capabilities of YOLO and DeepSORT algorithms, the system demonstrates high accuracy in detecting and tracking passengers, even in congested scenarios. Practical experiments have highlighted several challenges, including real-time frame processing rates, single-board computer performance, and the accuracy of passenger counts. It was discovered that the selection and positioning of USB cameras significantly influence system efficiency. Notably, changing the IP cameras to USB cameras significantly improves the processing speeds. A dataset containing images was created to improve the YOLO model's accuracy in detecting passengers. This dataset was particularly relevant considering the winter season, where identifying passengers could be challenging due to their bulky outerwear. To upgrade the performance of the DeepSORT system, the YOLO model was also improved with the pre-designed dataset to focus solely on the heads. This trained model achieved a recognition accuracy of 91% during peak hours. During periods of lighter traffic, when there were fewer passengers, the accuracy increased further due to reduced interference and higher precision. To enhance real-time processing efficiency, this research incorporates the status of public transport doors as a key parameter. By optimizing the number of frames forwarded to the YOLO algorithm for processing, we ensure that the system maintains accuracy without compromising on speed. Future development will focus on incorporating depth-sensing cameras and developing advanced data analysis algorithms for real-time processing on single-board computers. This will further enhance the precision of passenger counts during high-traffic periods. Expected benefits of this project include more efficient transport route planning, better management of passenger flows, improved rider satisfaction, and more effective measures against fare evasion.