-
Notifications
You must be signed in to change notification settings - Fork 1
/
train_tiffany.py
167 lines (156 loc) · 4.9 KB
/
train_tiffany.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# from lns.common.preprocess import Preprocessor
# dataset = Preprocessor.preprocess('ScaleLights')
# from lns.yolo.train import YoloTrainer
# trainer = YoloTrainer('darknet25_fullres_tiffany',dataset) #,load=True)
# trainer.train()
#### train squeezedet full res
# from lns.common.preprocess import Preprocessor
# dataset_scale = Preprocessor.preprocess('ScaleLights')
# dataset_utias = Preprocessor.preprocess('ScaleLights_New_Utias')
# dataset_youtube = Preprocessor.preprocess('ScaleLights_New_Youtube')
# dataset_scale_utias = dataset_scale.__add__(dataset_utias)
# dataset_all = dataset_scale_utias.__add__(dataset_youtube)
# dataset_all = dataset_all.merge_classes({
# "green": ["goLeft", "Green", "GreenLeft", "GreenStraightRight", "go", "GreenStraightLeft", "GreenRight", "GreenStraight", "3-green", "4-green", "5-green"],
# "yellow": ["warning", "Yellow", "warningLeft", "3-yellow", "4-yellow", "5-yellow"],
# "red": ["stop", "stopLeft", "RedStraightLeft", "Red", "RedLeft", "RedStraight", "RedRight", "3-red", "4-red", "5-red"],
# "off": ["OFF", "off", "3-off", "3-other", "4-off", "4-other", "5-off", "5-other"]
# })
# from lns.squeezedet.train import SqueezedetTrainer
# trainer = SqueezedetTrainer('squeezedet_fullres_tiffany',dataset_all)
# trainer.train()
#### train haar on lisa and scale
from lns.common.preprocess import Preprocessor
from lns.haar.train import HaarTrainer
dataset_lisa = Preprocessor.preprocess('lisa_signs')
dataset_scale = Preprocessor.preprocess('ScaleSigns', force=True)
print(dataset_scale)
dataset = dataset_lisa.__add__(dataset_scale)
# dataset = dataset.merge_classes({
# })
print(dataset.classes)
exit()
trainer = HaarTrainer('tiffany_test_all',dataset)
trainer.setup()
trainer.train()
"""
===== TRAINING 29-stage =====
<BEGIN
POS count : consumed 1000 : 1149
NEG count : acceptanceRatio 500 : 3.98295e-08
Precalculation time: 0
+----+---------+---------+
| N | HR | FA |
+----+---------+---------+
| 1| 1| 1|
+----+---------+---------+
| 2| 1| 1|
+----+---------+---------+
| 3| 1| 1|
+----+---------+---------+
| 4| 0.998| 0.976|
+----+---------+---------+
| 5| 0.998| 0.976|
+----+---------+---------+
| 6| 1| 0.98|
+----+---------+---------+
| 7| 1| 0.984|
+----+---------+---------+
| 8| 1| 0.976|
+----+---------+---------+
| 9| 0.998| 0.976|
+----+---------+---------+
| 10| 0.999| 0.98|
+----+---------+---------+
| 11| 0.999| 0.952|
+----+---------+---------+
| 12| 0.999| 0.96|
+----+---------+---------+
| 13| 0.996| 0.928|
+----+---------+---------+
| 14| 0.996| 0.946|
+----+---------+---------+
| 15| 0.998| 0.972|
+----+---------+---------+
| 16| 0.996| 0.936|
+----+---------+---------+
| 17| 0.996| 0.904|
+----+---------+---------+
| 18| 0.996| 0.884|
+----+---------+---------+
| 19| 0.996| 0.86|
+----+---------+---------+
| 20| 0.996| 0.858|
+----+---------+---------+
| 21| 0.996| 0.862|
+----+---------+---------+
| 22| 0.996| 0.916|
+----+---------+---------+
| 23| 0.996| 0.862|
+----+---------+---------+
| 24| 0.996| 0.888|
+----+---------+---------+
| 25| 0.996| 0.848|
+----+---------+---------+
| 26| 0.996| 0.896|
+----+---------+---------+
| 27| 0.996| 0.89|
+----+---------+---------+
| 28| 0.996| 0.866|
+----+---------+---------+
| 29| 0.996| 0.832|
+----+---------+---------+
| 30| 0.996| 0.904|
+----+---------+---------+
| 31| 0.996| 0.88|
+----+---------+---------+
| 32| 0.996| 0.818|
+----+---------+---------+
| 33| 0.996| 0.78|
+----+---------+---------+
| 34| 0.996| 0.774|
+----+---------+---------+
| 35| 0.996| 0.794|
+----+---------+---------+
| 36| 0.996| 0.818|
+----+---------+---------+
| 37| 0.996| 0.752|
+----+---------+---------+
| 38| 0.996| 0.736|
+----+---------+---------+
| 39| 0.996| 0.764|
+----+---------+---------+
| 40| 0.996| 0.768|
+----+---------+---------+
| 41| 0.996| 0.722|
+----+---------+---------+
| 42| 0.996| 0.726|
+----+---------+---------+
| 43| 0.996| 0.714|
+----+---------+---------+
| 44| 0.996| 0.682|
+----+---------+---------+
| 45| 0.996| 0.636|
+----+---------+---------+
| 46| 0.996| 0.618|
+----+---------+---------+
| 47| 0.996| 0.598|
+----+---------+---------+
| 48| 0.996| 0.608|
+----+---------+---------+
| 49| 0.996| 0.582|
+----+---------+---------+
| 50| 0.996| 0.56|
+----+---------+---------+
| 51| 0.996| 0.54|
+----+---------+---------+
| 52| 0.996| 0.568|
+----+---------+---------+
| 53| 0.996| 0.514|
+----+---------+---------+
| 54| 0.996| 0.476|
+----+---------+---------+
END>
Training until now has taken 1 days 21 hours 14 minutes 18 seconds.
Training completed at stage 29.
"""