This repository contains the code for an intelligent real-time vehicle counting system at a traffic light.
- Videos used: Friantroulette YouTube Channel
├── data/
│ ├── __init__.py
│ └── data_manager.py
├── gui/ # Graphical interface
│ ├── __init__.py
│ ├── app.py
│ └── gui.py
├── track/ # Vehicle tracking
│ ├── __init__.py
│ └── tracker.py
├── models/ # Trained model weights
│ └── model_main.pt # <-- Place the model weights here
├── reports/ # Outputs and reports
│ ├── report.csv # Example report in CSV format
│ └── report.png # Example report image
├── main.py # Application entry point
└── README.md
- Python 3.7 or higher
- pip
Install dependencies:
pip install -r requirements.txtBefore running the system, download the trained model weights from the following link:
The file should be placed in models/model_main.py.
Run the complete application (GUI + counting):
python main.py- In the interface, click Load video and select the desired video.
- After the video loads, click two distinct points on the video preview area to define the counting baseline.
- Click Play and the system will begin processing frames and display the real-time count in the interface.
- data_manager.py: loads and pre-processes video frames
- tracker.py: performs object-by-object vehicle tracking
- gui.py / app.py: presents the real-time interface with updated counts
- main.py: integrates all modules and starts the application
For questions, contact: jglg@cin.ufpe.br
