Skip to content

A hardware and software based solution utilizing various APIs for user verification and automatic payment deduction

Notifications You must be signed in to change notification settings

SankalpM-29/ML_Toll_Booth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ML_Toll_Booth

Block Diagram

Flowchart

FastAPI server for Number Plate Recognition

A server using TFOD2 custom trained model to localize on the numberplate in an image and after that using Cloud Vision API to extract characters from the image.

Project Structure

For Python Server

├───ANPR_centernet_resnet50_model
│   ├───checkpoint
│   └───saved_model
│       ├───assets
│       └───variables
├───object_detection
├───image_to_text.py
├───label_map.pbtxt
├───requirements.txt
├───stripe_customer.py
├───translation-322819-fd44443f9785.json
└───official

Demo

car image

car image

created upload page

upload page

output of numberplate

output for numberplate

To use the object detection model, we need "official" folder from official and "object_detection" folder from object_detection

Run Locally

  1. Create a virtual env using any python version >= 3.7.

  2. Install the required dependencies and run the following command in the project folder:

pip install -r requirements.txt
  1. To start local server:
uvicorn image_to_text:app --port 8000 --host 0.0.0.0

Deploying on VM

  1. After logging in as root user, run this commaand:
apt update
  1. Create a project folder. Our folder lies at /app/python_server. Use scp command to transfer files to VM or clone this repo using git.

  2. We are going to use python3 which comes preinstalled in most linux VMs. But we need to install pip separately using:

apt-get install python3-pip

📝 Note: Ideally it's advised to create a virtual python environment and then install all the packages.

  1. Install the required dependencies and run the following command in the project folder:
pip install -r requirements.txt
  1. To keep the server running, we need to create a service file in the path /etc/systemd/system/toll-booth.service. We will be using gunicorn server for deployment whose commands are already mentioned in the file.

  2. To start the service

systemctl start toll-booth.service

And to keep the server running even after reboot, run the following command:

systemctl enable toll-booth.service

About

A hardware and software based solution utilizing various APIs for user verification and automatic payment deduction

Resources

Stars

Watchers

Forks