Blankeos / license-plate-detection

πŸͺͺ Detect License Plate with YOLOV5, OpenCV, and EasyOCR. Built with PySide and Firebase.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

License Plate Detection

A super simple prototype of a license plate detection application.

Built with:

  • PySide6 - GUI
  • OpenCV - For image transformations
  • YoloV5 - For detections (Might upgrade to YoloV8)
  • EasyOCR - for OCR detection
  • Firebase - For cloud data storage.

Table of Contents

πŸ“ Running Requirements

🏁 Getting Started

Open your terminal and do the following:

  1. Git clone and go to directory
git clone https://github.com/Blankeos/license-plate-detection
cd license-plate-detection
  1. Create Virtual Env:
python -m venv .venv
  1. Activate Virtual Env:
# macOS/Linux
source .venv/bin/activate

# Windows
.venv\Scripts\activate
  1. Install Deps
# Install deps for the project.
pip install -r requirements.txt

# Install deps for the model.
git clone https://github.com/ultralytics/yolov5
pip install -r yolov5/requirements.txt
  1. Create a file called serviceAccount.json in the root and paste your Firebase Project Service Credentials

    This data is sensitive. Protect it or you risk getting spammed on Firebase.

    πŸ’‘ How to generate it.
    1. Go to project settings in Firebase. step 1 - go to project settings

    2. Generate private key. step 2 - generate private key

    3. Rename it to serviceAccount.json

      // Example `serviceAccount.json`
      {
        "type": "service_account",
        "project_id": "project-id-here",
        "private_key_id": "private-key-id-here",
        "private_key": "private-key-here",
        "client_email": "license-plate-detection-v1-ser@project-id-here.iam.gserviceaccount.com",
        "client_id": "123456789101112131415",
        "auth_uri": "https://accounts.google.com/o/oauth2/auth",
        "token_uri": "https://oauth2.googleapis.com/token",
        "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
        "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/subdomain.iam.gserviceaccount.com",
        "universe_domain": "googleapis.com"
      }
  2. Run the app (It will take a while the first run)

python main.py

Resources

https://realpython.com/python-pyqt-gui-calculator/

Notes

  • We use an existing YoloV5 model best.pt from this repo: here.

About

πŸͺͺ Detect License Plate with YOLOV5, OpenCV, and EasyOCR. Built with PySide and Firebase.


Languages

Language:Python 100.0%