Recognizing the importance of road safety, there arose a critical need for an accurate and dependable traffic sign classification system. The challenge is clear: developing an end-to-end solution that ensures accurate and dependable traffic sign classification, addressing the nuanced demands of real-world scenarios.
To meet the imperative need for an advanced traffic sign classification system, I initiated the development of a comprehensive solution. The objectives are outlined as follows:
-
Architect a Robust Neural Network: Utilize TensorFlow and tf Dataset for effective data augmentation and design a Convolutional Neural Network (CNN) architecture. This is essential for achieving an outstanding 88% classification accuracy, thereby contributing to reliable predictions and improving road safety.
-
Deploy on Google Cloud Platform (GCP): Establish a seamless deployment of the trained model on GCP, ensuring scalability and accessibility. This step is crucial for integrating the model seamlessly into the React Native mobile application, enhancing the practicality and reach of the classification system.
-
Integrate with React Native Application: Ensure the effective integration of the deployed model into a React Native mobile application. This integration facilitates real-time, on-the-go traffic sign classification, providing users with immediate and accurate insights to enhance their decision-making on the road.
- Install Python.
- Install Tensorflow Serving (Setup instructions)
- Install Nodejs.
- Install NPM.
- Install dependencies.
- Go to the React Native environment setup, then select
React Native CLI Quickstart
tab. - Install dependencies.
- Download the data from kaggle.
- Open
training/traffic_signs_detection_model.ipynb
in Jupyter Notebook. - Run all the Cells one by one.
- Copy the model generated and save it with the version number in the
models
folder.
- Get inside
api
folder - Run the FastAPI Server using uvicorn
- Get inside
api
folder. - Run the TF Serve (Update config file path below).
docker run -t --rm -p 8501:8501 -v C:/Code/Traffic-Sign-Detection-System:/Traffic-Sign-Detection-System tensorflow/serving --rest_api_port=8501 --model_config_file=/Traffic-Sign-Detection-System/models.config
- Run the FastAPI Server using uvicorn.
uvicorn main-tf-serving:app --reload --host 0.0.0.0
- Get inside
front
folder. - Update
REACT_APP_API_URL
to API URL in .env. - Run the frontend.
npm run start
- Get inside
mobile-app
folder - Update
URL
to API URL in .env. - Run the app (android/iOS)
npm run android
or
npm run ios
- Create a GCP account.
- Create a Project on GCP (Keep note of the project id).
- Create a GCP bucket.
- Upload the traffic.h5 model in the bucket in the traffic.h5`.
- Install Google Cloud SDK (Setup instructions).
- Authenticate with Google Cloud SDK.
gcloud auth login
- Run the deployment script.
cd gcp
gcloud functions deploy predict_lite --runtime python38 --trigger-http --memory 512 --project project_id
- Your model is now deployed.
- Use Postman to test the GCP using the Trigger URL.