-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
43 lines (31 loc) · 1.16 KB
/
main.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
# -*- coding: utf-8 -*-
import sys
sys.path.insert(0,'./src')
from model import DeepModel
from detection import TagDetector
from code_creator import CodeCreator
if __name__ == "__main__":
res = 0
model = DeepModel()
train_data, train_labels_one_hot, test_data, test_labels_one_hot = model.load_data()
model.load_weight()
while res != 4:
print("1 - Train")
print("2 - Test")
print("3 - Resimi Koda Dönüştür")
print("4 - Çıkış")
res = int(raw_input("----------> "))
if res == 1:
model.train_model(train_data, train_labels_one_hot)
elif res == 2:
model.test_model(test_data, test_labels_one_hot)
elif res == 3:
path = ""
path += "./samples/"
path += str(raw_input("Path : "))
detector = TagDetector(path)
data, locations = detector.detect_tags()
result, locations = model.predict(data,locations)
code_creator = CodeCreator(locations, result,"test")
code_creator.create_code()
detector.draw_rectange(result,locations)