The license plate recognition industry already has a certain market size, and it has achieved some applications in the fields of electronic police, highway bayonet, parking lot, business management, auto repair service and so on.
import glob
# Contains all .txt files except our listof classes
txt_files = [file for file inglob.glob('images/*.txt') if file != 'images/classes.txt']
# Read every .txt file and store it'scontent into variable curr
for file in txt_files:
with open(file, 'r') as f:
curr = f.read()
# Replace class index 15 with 1 and storeit in a variable new
new = curr.replace('15 ', '1 ')
# Once again open every .txt file and makethe replacement
for file in txt_files:
with open(file, 'w') as f:
f.write(new)
Effect picture:
Effect video:
Python license plate location and recognition video and pictures based on yolov5
Download link: