-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCardRecTester.py
38 lines (29 loc) · 1.1 KB
/
CardRecTester.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
import CardRecognition as cr2
import os
#
# MAIN
#
if __name__ == '__main__':
cr = cr2.CardRecognition()
path = './test'
while True:
filename = input('Enter Card Image: ')
if filename == '*':
net_acc = []
for filename in os.listdir(path):
print(filename)
cards, testnum, acc = cr.test_cards(os.path.join(path,filename))
print(cards)
for i in range(testnum):
net_acc.append(acc)
#print(acc)
print('==== Cummulative Net Accuracy: {:.3f}% ===='.format(100*sum(net_acc)/len(net_acc)))
print('-------------------------------------------')
else:
filename = os.path.join(path,filename)
if os.path.isfile(filename):
print(filename)
cards, _, _ = cr.test_cards(filename)
print('Are these your cards?')
print(cards)
print('^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^')