Git Product home page Git Product logo

traffic-sign-classifier's Introduction

Traffic sign classifier for Self driving car

LeNet implementation in Keras is used to build CNN. The CNN is trained on GTSRB dataset. This classifier pipelined with image segmentation module such as Haar cascade classifier to detect traffic signs can be used for Self driving cars.

test_50_1

Dependencies(Python 2.7):

  • keras - Tensorflow backend
  • os
  • pickle
  • numpy
  • cv2
  • csv
  • pandas
  • shutil
  • matplotlib

To download dataset:

run the following command in the project directory

$ ./downloadDataset.sh 

This will download the zip file and unzip in the current directory as GTSRB. The data formatting of images is given in Readme-Images.txt

To generate pickle files using GTSRB dataset

change the parameters according to the requirement

dataGen = datasetGenerator(nClasses=5, nTrainSamples=800, nTestSamples=100, nValidateSamples=100,imageSize=[28, 28])

  • nClasses - no of classes
  • nTrainSamples - no of Training samples
  • nTestSamples - no of test samples
  • nValidateSamples - no of validation samples
  • imageSize - size of 2D image matrix to be resized into.
$ python datasetGenerator.py

This will generate the following files

├── info.txt
├── test.p
├── train.p
└── validate.p

Training the network:

run CNNtrainer.py

$ python CNNtrainer.py

This will run for 10 epochs The model is saved in model directory as 2 files

  • model.h5 - which stores weights
  • model.json - which stores the architecture of CNN

To use this classifier:

An example is given in trafficSignalClassifier.py
Add cropped images to test directory and run the following code

$ python trafficSignClassifier.py

Complete directory structure

├── citation
├── CNNpredict.py
├── CNNtrainer.py
├── data
│   ├── info.txt
│   ├── test.p
│   ├── train.p
│   └── validate.p
├── datasetGenerator.py
├── downloadDataset.sh
├── GTSRB
│   ├── Final_Training
│   └── Readme-Images.txt
├── GTSRB_dataset.zip
├── model
│   ├── model.h5
│   └── model.json
├── README.md
├── signnames.csv
├── test
│   └── test_50_1.jpg
└── trafficSignClassifier.py

traffic-sign-classifier's People

Contributors

drakyanerlanggarizkiwardhana avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.