This project utilizes YOLOv8, a state-of-the-art real-time object detection system, to count people entering a bus and track their movements. The goal is to provide an efficient and accurate solution for monitoring passenger traffic.
Ensure you have the necessary dependencies installed by following the instructions in the requirements.txt
file.
pip install -r requirements.txt
Prepare your dataset or use pre-existing datasets containing bus footage for training and testing.
Train the YOLOv8 model on your dataset to enable it to detect and track people entering the bus. Update configurations and hyperparameters as needed.
python train.py --data data.yaml --cfg yolov8-custom.cfg --weights '' --batch-size 16 --epochs 300 --device 0
Run the trained model on new bus footage to count and track people. Adjust confidence thresholds and other parameters for optimal results.
python detect.py --source <your_video_or_image_path> --weights <path_to_trained_weights> --conf 0.5
Evaluate the model's performance, analyze results, and fine-tune parameters if necessary. This may involve adjusting IOU thresholds, confidence levels, etc.
- Ensure CUDA and cuDNN are properly configured for GPU acceleration.
- Customize the YOLOv8 configuration file (
yolov8-custom.cfg
) based on your specific requirements. - Use the
--weights
flag indetect.py
to load the trained weights for inference.
This project builds upon the YOLOv8 architecture, and we extend our gratitude to the YOLO community for their contributions.