This project is a Traffic Sign Classification System built using Python, TensorFlow/Keras, and Tkinter. It allows users to upload an image of a traffic sign, and the system will classify the sign using a pre-trained deep learning model.
- User-friendly GUI: Built with Tkinter for an intuitive user experience.
- Deep learning-powered classification: Uses a trained
traffic_classifier.h5
model for accurate predictions. - Predefined traffic sign classes: Supports the classification of 43 different traffic signs based on a standardized dataset.
- Model Improvement Capability: Allows training on new images to enhance model accuracy and robustness.
Ensure you have the following installed:
- Python 3.8+
- Required Python libraries (install via
requirements.txt
)
-
Clone the Repository
Clone the project to your local machine:git clone https://github.com/Victor-M16/Python-Traffic-Signs-Recognition-System.git cd Python-Traffic-Signs-Recognition-System
-
Install Dependencies
Install the required Python packages:pip install -r requirements.txt
-
Run the Application
Launch the GUI application:python gui.py
-
Start the Application
Run the application and wait for the GUI to appear. -
Upload an Image
- Click the "Upload an image" button.
- Use the file explorer to select an image of a traffic sign.
-
Classify the Image
- Click the "Classify Image" button to analyze the uploaded image.
- The predicted traffic sign will be displayed at the bottom of the GUI.
This project supports incremental training to improve the model using new images. Follow these steps:
-
Prepare Your Data
- Organize new traffic sign images into folders named according to their class IDs (e.g.,
0
,1
,2
, etc.). - Place these folders in a directory named
train
.
- Organize new traffic sign images into folders named according to their class IDs (e.g.,
-
Update the Model
- Run the training script provided in the repository to include new images in the training process:
python train.py
- The script will:
- Load existing data and the new images.
- Preprocess the data by resizing images to 30x30 pixels and normalizing them.
- Retrain the model with both old and new data.
- Run the training script provided in the repository to include new images in the training process:
-
Replace the Old Model
- The updated model will be saved as
my_model.h5
. - Replace the existing
traffic_classifier.h5
in thegui.py
code withmy_model.h5
to use the improved version.
- The updated model will be saved as
The system can recognize the following traffic signs:
- Speed limit (20km/h)
- Speed limit (30km/h)
- Speed limit (50km/h)
...
(Complete list available in the source code.)
gui.py
: Main application script for the GUI.train.py
: Script for training the model with new or additional images.traffic_classifier.h5
: Pre-trained model for classifying traffic signs.requirements.txt
: Python dependencies for the project.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Feel free to fork the repository and submit a pull request.
- The pre-trained model is based on a standardized traffic signs dataset.
- Tkinter was used to design the GUI for easy interaction.
Enjoy using the Traffic Sign Classification System! 🚦