-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDataset_creacion.py
99 lines (68 loc) · 1.97 KB
/
Dataset_creacion.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
'''
José Enrique Maese Álvarez
TFG:
'''
import Dataset_Funciones as df
import cv2
for i in range(1):
print('Recortando imagen ' + str(i))
df.RecorteMatricula(str(i))
cv2.destroyAllWindows()
#%%
#José Enrique Maese Álvarez
#TFG:
import Dataset_Funciones as df
import cv2
import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'
for i in range(126):
print('Recortando matricula ' + str(i))
df.RecorteCaracteres(str(i), alpha1=0.8, alpha2=0.6, beta=0.05, limite_binarizado=125, tam=32)
cv2.destroyAllWindows()
#%% LENET
import LeNet
import numpy as np
LeNet.Lenet(0.0001, 25)
# ep = [10, 15, 20, 25]
# lr = [0.1, 0.01, 0.001, 0.0001]
# datos_Lenet=np.zeros((16, 4))
# pos = 0
# for i in lr:
# for j in ep:
# (loss, acc, val_loss, val_acc) = LeNet.Lenet(i, j)
# datos_Lenet[pos, 0] = loss
# datos_Lenet[pos, 1] = acc
# datos_Lenet[pos, 2] = val_loss
# datos_Lenet[pos, 3] = val_acc
# pos = pos + 1
#%% ALEXNET
import AlexNet
import numpy as np
AlexNet.AlexNet(0.001, 25)
# ep = [15, 20, 25, 30]
# lr = [0.01, 0.001, 0.0001, 0.00001]
# datos_Alexnet = np.zeros((16, 4))
# pos = 0
# for i in lr:
# for j in ep:
# (loss, acc, val_loss, val_acc) = AlexNet.AlexNet(i, j)
# datos_Alexnet[pos, 0] = loss
# datos_Alexnet[pos, 1] = acc
# datos_Alexnet[pos, 2] = val_loss
# datos_Alexnet[pos, 3] = val_acc
# pos = pos + 1
#%% RESNET
import ResNet
import numpy as np
ep = [30, 35, 40, 45]
lr = [0.001, 0.0001, 0.00001, 0.000001]
datos_Resnet = np.zeros((16, 4))
pos = 0
for i in lr:
for j in ep:
(loss, acc, val_loss, val_acc) = ResNet.ResNet(i, j)
datos_Resnet[pos, 0] = loss
datos_Resnet[pos, 1] = acc
datos_Resnet[pos, 2] = val_loss
datos_Resnet[pos, 3] = val_acc
pos = pos + 1