Git Product home page Git Product logo

zuhaibbutt786 / traffic-sign-classification-and-detection Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 9.6 MB

The aim of this project is to focus on the first fundamental features of the decision making ability of an autonomous vehicle, i.e., to develop a deep learning model that reads traffic signs and classifies them correctly using Convolutional Neural Networks(CNNs)

Jupyter Notebook 98.49% Procfile 0.04% Python 1.47%

traffic-sign-classification-and-detection's Introduction

Traffic_Sign_Classifier-with-Streamlit

App:

App Output

alt text

Project overview

  • The aim of this project is to focus on the first fundamental features of the decision making ability of an autonomous vehicle, i.e., to develop a deep learning model that reads traffic signs and classifies them correctly using Convolutional Neural Networks(CNNs).

  • The traffic sign classifier uses a German traffic dataset. The German traffic dataset consists of 34,799 32*32 pixels colored images that is used for the training dataset, 12,630 images are used for the testing dataset and 4410 images are used in the validation dataset where each images is a photo of a traffic sign belonging to one of the 43 classes i.e., traffic sign types.

Dataset:

Train Data: https://drive.google.com/open?id=1ZrJJvIbZ5vUHjyzUGNXGl4sRS7zlU5Db

Validation Data: https://drive.google.com/open?id=1bLWaYJZHroOyfPVscVdBjh9atjvHDdFj

Test Data: https://drive.google.com/open?id=127Usik6jjD_oBhr5hDojgLARW9XYxWdr

Folders Description

Google Colab Notebook

Contains the whole process of building the CNN Model

  • Load the Pickled dataset
  • Use Seaborn to visualise the data.
  • Preprocess the images using OpenCV.
  • Use ImageDataGenerator for image augmentation and help the model generalise it's results.
  • build_model() function takes hyperparameter(hp) as input and we start building our CNN model using KerasTuner and then compile our model.
  • KerasTuner gives us the best hyperparameter combinations using RandomSearch method.
  • We now create a model checkpoint and then fit the model and run it for 40 epochs.
  • Now Load the model's weights and biases and evaluate it on our test dataset.
  • Save our model in Keras HDF5 format.
  • Use the saved model to test on random images.

Test Random Images

  • This contains images from the internet. A total of 43 images belonging to each class.
  • Our model will be tested using this unseen data

Streamlit App Output

  • Contains the App's final output

Class Names and Labels

  • Contains the signnames.csv file

Result Excel

  • Conatins a exccel sheet having the results of our test results on random images from the internet
  • Also contains the accuracy of our model on unseen data
  • Accuracy on unseen data : 79.06%

Model

Contains the saved keras model named

  • Traffic_sign_classifier_CNN.hdf5

Files for our Streamlit App

classify.py

  • get_model(): Loads the saved model into cache using streamlit's "@st.cache" feature.
  • predict(): Takes an image as input from the function parameter, preprocesses it and feeds it to the model for results.

app.py

  • Contains the front-end code for the streamlit app.
  • Imports the predict() function fetches the result and displays it.

Procfile

A Procfile is a file which describes how to run your application.

requirements.txt

This has all the dependencies required to deploy our application on Heroku

Run this app on your system.

Requirements

  • Python 3.6+
  • NumPy
  • Pillow
  • TensorFlow 2.x
  • Streamlit

To run it on your system

  • Install all the dependencies
  • Clone this repository
  • You need the Streamlit App folder to run this application.
  • In your Command line/Terminal go to the directory where you have upload.py file then type

streamlit run app.py

traffic-sign-classification-and-detection's People

Stargazers

 avatar

Watchers

 avatar  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.