The system is built using yolov5 (objects detector) [Reference 1] and PaddlePaddle OCR (license plate recognition) [Reference 2]
It will be used to detect vehicles including Cars and Vans and send the NumberPlate detections over to a FastAPI backend server which will perform the License Plate Recognition (LPR) and allow the access to authorized vehicles.
Before running the project, make sure to first setup the FastAPI backend server, to do so please refer to the following server instructions.
- To Run the Cargate project on a PC, please refer to the following PC instructions.
- To Run the Cargate project on a Jetson Nano, choose from the following two options:
The Following scripts were tested on a Jetson Nano with JetPack 4.5 image flashed. To download Jetpack 4.5, refer to the following link.
./install_torch.sh
pip3 install -r Carplate-yolov5/requirements-nano.txt
gdown https://drive.google.com/uc?id=18tyNWkGC_x9FddZ9hJ5di3_Sc9WPkpd_ -O Carplate-yolov5/yolov5/weights/detection.pt
Detect vehicles using the CSI Camera and send NumberPlate detections over to a FastAPI backend server to perform LPR.
python3 Carplate-yolov5/main.py --show --nano
The Following scripts were tested on a Jetson Nano with JetPack 4.5 image flashed. To download Jetpack 4.5, refer to the following link.
This sets "default-runtime": "nvidia"
in /etc/docker/daemon.json
./setup.sh
Note: This should take approximately 3-4 hours to complete
./build.sh
Detect vehicles using the CSI Camera and send NumberPlate detections over to a FastAPI backend server to perform LPR.
./run.sh
There are 2 external sensors used in this project:
- HC-SR04 Ultrasonic Distance Sensor: Used to determine if a vehicle is present before starting the detection. (link)
- 1 CH Active H/L 5V Relay Module: Used to control the gate and grant access to authorized vehicles. (link)
There are 2 ways that you can use to run shell scripts on Linux:
1) By using the bash command:
$ bash ./scriptname.sh
2) By making the script executable (To be performed only once):
$ chmod +x scriptname.sh
Then run the script normally using the command:
$ ./scriptname.sh