Skip to content

matin-ghorbani/Iranian-License-Plate-Pipeline

Repository files navigation

License Plate Pipeline (Detection, Recognition, Verification)

These tasks solved with this repo

  • Detection: I trained Yolov8 on Iranian License Plates on this dataset
  • Recognition: I used and trained Deep Text Recognition Benchmark on Iranian License Plates on this dataset
  • Verification: License plate verification is implemented to know which license plate is stored in the database. I used sqlite3 for database

How to install

Run this command:

pip install -r requirements.txt

How to run identification:

First Download These Weights:

License plate detector weights Put this in weights/yolov8-detector directory
License plate recognizer weights Put this in weights/dtrb-recognizer directory

Then run this command

python main.py --input-img YOUR_IMAGE.JPG

You can also see the other arguments of it with this command

python main.py --help

For Example:

  • --detector-weight: You can train your own detector and then use it.
  • --recognizer-weight: You can train your own recognizer and then use it.
  • --threshold: You can change the threshold of detector.
  • --show-output: You can show the output in your screen.
  • --save-output: You can save the output in io/output directory.

Result of identification:

Result Of Identification

How to run verification:

First Download These Weights:

License plate detector weights Put this in weights/yolov8-detector directory
License plate recognizer weights Put this in weights/dtrb-recognizer directory

Then run this command to create your database:

python create_db.py --db-name YOUR_DB_NAME.DB

Also you can change names and plates in the create_db.py:

names: list[str] = [
    'Celestino Schuster',
    'Micheal Schumm',
    'Greg Jones'
]

license_plates: list[str] = [
    '13n73199',
    '12p73289',
    '98i37829'
]

After that run this command

python verification.py --db-name YOUR_DB_NAME.DB --input-img YOUR_IMAGE.jpg

You can also see the other arguments of it with this command

python verification.py --help

For Example:

  • --detector-weight: You can train your own detector and then use it.
  • --recognizer-weight: You can train your own recognizer and then use it.
  • --threshold: You can change the threshold of detector.
  • --show-output: You can show the output in your screen.
  • --save-output: You can save the output in io/output directory.
  • --threshold-verification: You can change the threshold of verification.

Result of verification:

Result Of Verification

Releases

No releases published

Packages

No packages published

Languages