-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCheckPlateLabel.py
43 lines (38 loc) · 1.52 KB
/
CheckPlateLabel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# IMG_FILE_PATH = "C:\Users\pc\Desktop\Dataset_for_LPR-master\Black-box_01"
LABEL_FILE_PATH = "C:/Users/pc/Desktop/보도육교2/보도육교2_part5/"
PLATE_FILE_PATH = "C:/Users/pc/Desktop/보도육교2/보도육교2_plate/"
currIdx = 599
currSubIdx = 0
currFile = 'DSCF1' + str('%03d' % currIdx) + str('_%d' % currSubIdx if currSubIdx != 0 else '')
for i in range(160):
for j in range(5):
label_count = 0
try:
f = open(file=LABEL_FILE_PATH + currFile + '.txt', mode='r', encoding='utf-8')
for line in f:
if line[0] == '9':
label_count += 1
# print('label', currFile, label_count)
f.close()
except:
# print("no label file name such", currFile)
print(end="")
# currIdx += 1
plate_count = 0
try:
f = open(file=PLATE_FILE_PATH + currFile + '.txt', mode='r')
plate_count = len(f.readlines())
# print('plate', currFile, plate_count)
f.close()
except:
# print("no plate file name such", currFile)
print(end="")
if plate_count != label_count:
print('label', currFile, label_count)
print('plate', currFile, plate_count)
print(currFile, '\n')
currSubIdx += 1
currFile = 'DSCF1' + str('%03d' % currIdx) + str('_%d' % currSubIdx if currSubIdx != 0 else '')
currSubIdx = 0
currIdx += 1
print(currFile, 'done')