forked from kerlomz/captcha_trainer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.py
111 lines (88 loc) · 2.13 KB
/
constants.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
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Author: kerlomz <[email protected]>
from enum import Enum, unique
@unique
class ModelType(Enum):
"""模型类别枚举"""
PB = 'PB'
ONNX = 'ONNX'
TFLITE = 'TFLITE'
@unique
class DatasetType(Enum):
"""数据集类别枚举"""
Directory = 'Directory'
TFRecords = 'TFRecords'
@unique
class LabelFrom(Enum):
"""标签来源枚举"""
XML = 'XML'
LMDB = 'LMDB'
FileName = 'FileName'
TXT = 'TXT'
@unique
class LossFunction(Enum):
"""损失函数枚举"""
CrossEntropy = 'CrossEntropy'
CTC = 'CTC'
@unique
class ModelScene(Enum):
"""模型场景枚举"""
Classification = 'Classification'
@unique
class ModelField(Enum):
"""模型类别枚举"""
Image = 'Image'
Text = 'Text'
@unique
class RunMode(Enum):
"""运行模式枚举"""
Validation = 'Validation'
Trains = 'Trains'
Predict = 'Predict'
@unique
class CNNNetwork(Enum):
"""卷积层枚举"""
CNNX = 'CNNX'
CNN5 = 'CNN5'
# 不建议使用CNN3,过于精简,可能无法很好的收敛
CNN3 = 'CNN3'
ResNetTiny = 'ResNetTiny'
ResNet50 = 'ResNet50'
DenseNet = 'DenseNet'
MobileNetV2 = 'MobileNetV2'
@unique
class RecurrentNetwork(Enum):
"""循环层枚举"""
NoRecurrent = 'NoRecurrent'
GRU = 'GRU'
BiGRU = 'BiGRU'
GRUcuDNN = 'GRUcuDNN'
LSTM = 'LSTM'
BiLSTM = 'BiLSTM'
LSTMcuDNN = 'LSTMcuDNN'
BiLSTMcuDNN = 'BiLSTMcuDNN'
@unique
class Optimizer(Enum):
"""优化器枚举"""
RAdam = 'RAdam'
Adam = 'Adam'
Momentum = 'Momentum'
AdaBound = 'AdaBound'
SGD = 'SGD'
AdaGrad = 'AdaGrad'
RMSProp = 'RMSProp'
@unique
class SimpleCharset(Enum):
"""简单字符分类枚举"""
NUMERIC = 'NUMERIC'
ALPHANUMERIC = 'ALPHANUMERIC'
ALPHANUMERIC_LOWER = 'ALPHANUMERIC_LOWER'
ALPHANUMERIC_UPPER = 'ALPHANUMERIC_UPPER'
ALPHABET_LOWER = 'ALPHABET_LOWER'
ALPHABET_UPPER = 'ALPHABET_UPPER'
ALPHABET = 'ALPHABET'
ARITHMETIC = 'ARITHMETIC'
FLOAT = 'FLOAT'
CHS_3500 = 'CHS_3500'
ALPHANUMERIC_CHS_3500_LOWER = 'ALPHANUMERIC_CHS_3500_LOWER'