-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyUI.py
232 lines (225 loc) · 11.3 KB
/
myUI.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'myUI.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.setWindowModality(QtCore.Qt.ApplicationModal)
Form.resize(585, 500)
Form.setMinimumSize(QtCore.QSize(585, 500))
font = QtGui.QFont()
font.setPointSize(9)
font.setStyleStrategy(QtGui.QFont.NoAntialias)
Form.setFont(font)
Form.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("../../Temp/emnist/train/cc/c-0.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
Form.setWindowIcon(icon)
Form.setWindowOpacity(1.0)
Form.setToolTipDuration(-1)
Form.setWhatsThis("")
Form.setAutoFillBackground(True)
self.verticalLayout_3 = QtWidgets.QVBoxLayout(Form)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.label = QtWidgets.QLabel(Form)
self.label.setCursor(QtGui.QCursor(QtCore.Qt.CrossCursor))
self.label.setMouseTracking(False)
self.label.setStyleSheet("")
self.label.setFrameShape(QtWidgets.QFrame.WinPanel)
self.label.setFrameShadow(QtWidgets.QFrame.Sunken)
self.label.setText("")
self.label.setObjectName("label")
self.horizontalLayout_4.addWidget(self.label)
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setSpacing(18)
self.verticalLayout.setObjectName("verticalLayout")
self.lcdNumber = QtWidgets.QLCDNumber(Form)
font = QtGui.QFont()
font.setFamily("Adobe Arabic")
font.setPointSize(24)
font.setStyleStrategy(QtGui.QFont.NoAntialias)
self.lcdNumber.setFont(font)
self.lcdNumber.setCursor(QtGui.QCursor(QtCore.Qt.WhatsThisCursor))
self.lcdNumber.setAcceptDrops(False)
self.lcdNumber.setFrameShadow(QtWidgets.QFrame.Plain)
self.lcdNumber.setDigitCount(2)
self.lcdNumber.setMode(QtWidgets.QLCDNumber.Dec)
self.lcdNumber.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
self.lcdNumber.setProperty("intValue", 20)
self.lcdNumber.setObjectName("lcdNumber")
self.verticalLayout.addWidget(self.lcdNumber)
self.pushButton = QtWidgets.QPushButton(Form)
font = QtGui.QFont()
font.setPointSize(10)
font.setStyleStrategy(QtGui.QFont.NoAntialias)
self.pushButton.setFont(font)
self.pushButton.setCursor(QtGui.QCursor(QtCore.Qt.OpenHandCursor))
self.pushButton.setObjectName("pushButton")
self.verticalLayout.addWidget(self.pushButton)
self.pushButton_4 = QtWidgets.QPushButton(Form)
font = QtGui.QFont()
font.setPointSize(10)
font.setStyleStrategy(QtGui.QFont.NoAntialias)
self.pushButton_4.setFont(font)
self.pushButton_4.setCursor(QtGui.QCursor(QtCore.Qt.OpenHandCursor))
self.pushButton_4.setObjectName("pushButton_4")
self.verticalLayout.addWidget(self.pushButton_4)
self.pushButton_3 = QtWidgets.QPushButton(Form)
font = QtGui.QFont()
font.setPointSize(10)
self.pushButton_3.setFont(font)
self.pushButton_3.setCursor(QtGui.QCursor(QtCore.Qt.ClosedHandCursor))
self.pushButton_3.setObjectName("pushButton_3")
self.verticalLayout.addWidget(self.pushButton_3)
self.comboBox = QtWidgets.QComboBox(Form)
self.comboBox.setMinimumSize(QtCore.QSize(140, 30))
font = QtGui.QFont()
font.setPointSize(9)
font.setBold(True)
font.setWeight(75)
self.comboBox.setFont(font)
self.comboBox.setCursor(QtGui.QCursor(QtCore.Qt.OpenHandCursor))
self.comboBox.setAutoFillBackground(True)
self.comboBox.setEditable(False)
self.comboBox.setMaxVisibleItems(10)
self.comboBox.setObjectName("comboBox")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.verticalLayout.addWidget(self.comboBox)
self.checkBox = QtWidgets.QCheckBox(Form)
self.checkBox.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.checkBox.setMouseTracking(False)
self.checkBox.setChecked(True)
self.checkBox.setObjectName("checkBox")
self.verticalLayout.addWidget(self.checkBox)
self.pushButton_2 = QtWidgets.QPushButton(Form)
font = QtGui.QFont()
font.setPointSize(10)
font.setStyleStrategy(QtGui.QFont.PreferDefault)
self.pushButton_2.setFont(font)
self.pushButton_2.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_2.setObjectName("pushButton_2")
self.verticalLayout.addWidget(self.pushButton_2)
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setContentsMargins(0, -1, -1, -1)
self.horizontalLayout_3.setSpacing(6)
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.label_3 = QtWidgets.QLabel(Form)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
self.label_3.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
font.setKerning(True)
font.setStyleStrategy(QtGui.QFont.NoAntialias)
self.label_3.setFont(font)
self.label_3.setAutoFillBackground(True)
self.label_3.setFrameShape(QtWidgets.QFrame.NoFrame)
self.label_3.setFrameShadow(QtWidgets.QFrame.Plain)
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
self.label_3.setObjectName("label_3")
self.horizontalLayout_3.addWidget(self.label_3)
self.label_4 = QtWidgets.QLabel(Form)
self.label_4.setMinimumSize(QtCore.QSize(0, 0))
font = QtGui.QFont()
font.setFamily("Adobe Arabic")
font.setPointSize(29)
font.setBold(True)
font.setItalic(True)
font.setWeight(75)
self.label_4.setFont(font)
self.label_4.setMouseTracking(False)
self.label_4.setAutoFillBackground(False)
self.label_4.setFrameShape(QtWidgets.QFrame.Box)
self.label_4.setText("")
self.label_4.setTextFormat(QtCore.Qt.AutoText)
self.label_4.setAlignment(QtCore.Qt.AlignCenter)
self.label_4.setObjectName("label_4")
self.horizontalLayout_3.addWidget(self.label_4)
self.horizontalLayout_3.setStretch(0, 1)
self.horizontalLayout_3.setStretch(1, 5)
self.verticalLayout.addLayout(self.horizontalLayout_3)
self.verticalLayout.setStretch(0, 3)
self.verticalLayout.setStretch(1, 1)
self.verticalLayout.setStretch(2, 1)
self.verticalLayout.setStretch(3, 1)
self.verticalLayout.setStretch(4, 5)
self.verticalLayout.setStretch(5, 1)
self.verticalLayout.setStretch(6, 1)
self.verticalLayout.setStretch(7, 3)
self.horizontalLayout_4.addLayout(self.verticalLayout)
self.horizontalLayout_4.setStretch(0, 100)
self.horizontalLayout_4.setStretch(1, 1)
self.verticalLayout_2.addLayout(self.horizontalLayout_4)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.label_2 = QtWidgets.QLabel(Form)
font = QtGui.QFont()
font.setFamily("SimSun-ExtB")
font.setPointSize(10)
font.setStyleStrategy(QtGui.QFont.NoAntialias)
self.label_2.setFont(font)
self.label_2.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
self.label_2.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.label_2.setObjectName("label_2")
self.horizontalLayout_2.addWidget(self.label_2)
self.horizontalSlider = QtWidgets.QSlider(Form)
self.horizontalSlider.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.horizontalSlider.setAcceptDrops(False)
self.horizontalSlider.setAutoFillBackground(True)
self.horizontalSlider.setMinimum(1)
self.horizontalSlider.setProperty("value", 20)
self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal)
self.horizontalSlider.setObjectName("horizontalSlider")
self.horizontalLayout_2.addWidget(self.horizontalSlider)
self.verticalLayout_2.addLayout(self.horizontalLayout_2)
self.verticalLayout_2.setStretch(0, 100)
self.verticalLayout_2.setStretch(1, 1)
self.verticalLayout_3.addLayout(self.verticalLayout_2)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "手写字母识别 - 黄立宏"))
self.label.setToolTip(_translate("Form", "画板"))
self.lcdNumber.setToolTip(_translate("Form", "画笔大小"))
self.pushButton.setToolTip(_translate("Form", "选择一张图片文件进行识别"))
self.pushButton.setText(_translate("Form", "打开文件"))
self.pushButton_4.setToolTip(_translate("Form", "将画板内容保存为图片"))
self.pushButton_4.setText(_translate("Form", "保存画板"))
self.pushButton_4.setShortcut(_translate("Form", "Ctrl+S"))
self.pushButton_3.setToolTip(_translate("Form", "清空画板内容"))
self.pushButton_3.setText(_translate("Form", "清空画板"))
self.pushButton_3.setShortcut(_translate("Form", "Ctrl+Z"))
self.comboBox.setToolTip(_translate("Form", "卷积模型"))
self.comboBox.setCurrentText(_translate("Form", "ResNet18"))
self.comboBox.setItemText(0, _translate("Form", "ResNet18"))
self.comboBox.setItemText(1, _translate("Form", "Inception10"))
self.comboBox.setItemText(2, _translate("Form", "VGG16"))
self.comboBox.setItemText(3, _translate("Form", "AlexNet8"))
self.comboBox.setItemText(4, _translate("Form", "Lenet5"))
self.checkBox.setToolTip(_translate("Form", "是否进行大小写混合识别"))
self.checkBox.setText(_translate("Form", "大小写混合"))
self.checkBox.setShortcut(_translate("Form", "Ctrl+Space"))
self.pushButton_2.setToolTip(_translate("Form", "开始识别画板内容"))
self.pushButton_2.setText(_translate("Form", "开始识别"))
self.pushButton_2.setShortcut(_translate("Form", "Return"))
self.label_3.setText(_translate("Form", "结果:"))
self.label_4.setToolTip(_translate("Form", "识别结果"))
self.label_2.setText(_translate("Form", "调节画笔大小:"))
self.horizontalSlider.setToolTip(_translate("Form", "调节画笔大小"))