This study presents the development and evaluation of an automatic passenger counting system for public buses using the YOLOv8 algorithm based on Convolutional Neural Networks (CNN). Accurate passenger counting plays a crucial role in optimizing public transportation operations, as it enables effective capacity management, reduces operational costs, and improves overall passenger comfort. Conventional manual counting methods are often inefficient, time-consuming, and prone to human error, particularly in high-density urban transportation environments. Therefore, an automated and intelligent solution is required to support real-time monitoring and operational decision-making. The proposed system employs deep learning-based object detection to identify and count passengers from video streams captured by cameras installed inside buses. Two camera positions, namely front and rear views, were evaluated to assess system performance under different visual conditions. The experimental results show that the system achieves high detection accuracy in the front camera view, with a confidence score of 0.82, indicating reliable performance in scenarios with minimal object occlusion. In contrast, the rear camera view demonstrates slightly lower accuracy, with a confidence score of 0.76, mainly due to increased object overlap and variations in lighting conditions. These findings emphasize the importance of appropriate camera placement and environmental consideration in improving detection reliability. In addition, the implementation of the proposed system enables real-time monitoring of passenger flow, which supports dynamic scheduling, demand-based route planning, and efficient fleet management. Accurate passenger data allows transportation operators to optimize service allocation, reduce congestion, and enhance overall service quality. Overall, this study contributes to the development of intelligent transportation systems by demonstrating the practical applicability of deep learning-based passenger counting solutions. The proposed approach offers strong potential for real-world deployment in smart city environments, supporting the creation of more sustainable, efficient, and passenger-oriented public transportation services.