This project presents a PyTorch implementation of a Convolutional Neural Network (CNN) for the task of traffic sign classification. The model is trained on a custom dataset of traffic sign images, using PyTorch for both model construction and training.
- Data Handling: Includes functions to load and split data into training, validation, and testing sets.
- Custom PyTorch Dataset: Implementation of a custom dataset class for handling image data within PyTorch.
- Data Augmentation: Utilizes data augmentation techniques for better model generalization.
- CNN Architecture: A CNN model with multiple convolutional and fully connected layers.
- Training and Validation: Functions for training the model and evaluating its performance on a validation dataset.
To run this project, install the required libraries as listed below:
- PyTorch
- NumPy
- OpenCV
- scikit-learn
You can install these packages using pip
:
pip install torch numpy opencv-python scikit-learn
To use this project:
- Clone the repository.
- Place your dataset in the appropriate directory.
- Run the Jupyter Notebook to train the model.
The training process involves several steps including loading data, applying transformations, and training the model over multiple epochs. The model's performance is evaluated at the end of each epoch.
The script includes a section for real-time testing of the trained model using a webcam feed.
Feel free to fork this project and submit pull requests for any improvements or bug fixes.
This project is open-source and available under the MIT License.