How To Use • How To Run Locally • Built process • Feedback
App link: https://boramorka-traffic-sign-prediction-app-1-appmain-app-pxaza3.streamlitapp.com/
Note: The model was trained on German road signs. please use German signs.
Note: The application may be in sleep mode. In this case, you will see an offer to wake it up. You'll have to wait a couple of minutes.
# Clone this repository
$ git clone https://github.com/boramorka/Traffic-sign-prediction-app_1.git
# Go into the repository
$ cd Traffic-sign-prediction-app_1
# Load traffic_sign_model.h5 from app folder and test it using Keras API
Development process described in Traffic sign prediction model building jupyter notebook
Main notes:
- Libraries:
# Importing libraries import os import pandas as pd import numpy as np import matplotlib.pyplot as plt from matplotlib.image import imread import seaborn as sns import random from PIL import Image from sklearn.model_selection import train_test_split from tensorflow.keras.utils import to_categorical import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Flatten, Dropout, Conv2D, MaxPool2D
- Device: NVIDIA GeForce RTX 2060
- Model Architectue:
model = Sequential() model.add(Conv2D(filters = 64, kernel_size = (3,3), input_shape = x_train.shape[1:], activation = 'relu', padding = 'same')) model.add(MaxPool2D(pool_size=(2,2))) model.add(Dropout(0.5)) model.add(Conv2D(filters = 64, kernel_size = (3,3), activation = 'relu')) model.add(MaxPool2D(pool_size=(2,2))) model.add(Dropout(0.5)) model.add(Flatten()) model.add(Dense(128, activation = 'relu')) model.add(Dropout(0.5)) model.add(Dense(43, activation = 'softmax'))
- Total params: 445 803
We started with downloading the dataset, preprocessing it, created the model and found out the predictions using the model. During preprocessing we found that this dataset has 43 classes. Model reached an accuracy of 95%+ in just 50 epochs, we can further optimize the model using hyper parameter tuning and reach a higher accuracy.
This model can be used in self driving cars which will enable them to automatically recognize traffic signs similarly the driver alert system inside cars will help and protect drivers by understanding the traffic signs around them.
🤵 Feel free to send me feedback on Telegram. Feature requests are always welcome.