-
Notifications
You must be signed in to change notification settings - Fork 2
/
mask_json_convert_python.py
321 lines (315 loc) · 18.2 KB
/
mask_json_convert_python.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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:/Users/MEHMET/GitHub/Mask-to-json-to-mask/mask_json_convert.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_converter(object):
def setupUi(self, converter):
converter.setObjectName("converter")
converter.resize(700, 536)
converter.setMinimumSize(QtCore.QSize(700, 500))
converter.setMaximumSize(QtCore.QSize(700, 536))
self.centralwidget = QtWidgets.QWidget(converter)
self.centralwidget.setStyleSheet("background-image: url(:/icons/images/background.jpg);")
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.stackedWidget = QtWidgets.QStackedWidget(self.centralwidget)
self.stackedWidget.setObjectName("stackedWidget")
self.page_3 = QtWidgets.QWidget()
self.page_3.setObjectName("page_3")
self.gridLayout_3 = QtWidgets.QGridLayout(self.page_3)
self.gridLayout_3.setContentsMargins(0, 0, 0, 0)
self.gridLayout_3.setObjectName("gridLayout_3")
self.gridLayout_2 = QtWidgets.QGridLayout()
self.gridLayout_2.setVerticalSpacing(0)
self.gridLayout_2.setObjectName("gridLayout_2")
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_2.addItem(spacerItem, 0, 0, 1, 1)
spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_2.addItem(spacerItem1, 8, 0, 1, 1)
self.horizontalLayout_9 = QtWidgets.QHBoxLayout()
self.horizontalLayout_9.setObjectName("horizontalLayout_9")
self.gridLayout_2.addLayout(self.horizontalLayout_9, 10, 1, 1, 1)
self.label_2 = QtWidgets.QLabel(self.page_3)
self.label_2.setMinimumSize(QtCore.QSize(200, 0))
font = QtGui.QFont()
font.setPointSize(11)
self.label_2.setFont(font)
self.label_2.setObjectName("label_2")
self.gridLayout_2.addWidget(self.label_2, 7, 0, 1, 1)
self.horizontalLayout_10 = QtWidgets.QHBoxLayout()
self.horizontalLayout_10.setContentsMargins(-1, 0, -1, -1)
self.horizontalLayout_10.setObjectName("horizontalLayout_10")
self.progressBar_2 = QtWidgets.QProgressBar(self.page_3)
self.progressBar_2.setProperty("value", 0)
self.progressBar_2.setObjectName("progressBar_2")
self.horizontalLayout_10.addWidget(self.progressBar_2)
self.gridLayout_2.addLayout(self.horizontalLayout_10, 14, 1, 1, 1)
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_2.addItem(spacerItem2, 2, 0, 1, 1)
spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_2.addItem(spacerItem3, 13, 0, 1, 1)
self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
self.horizontalLayout_6.setContentsMargins(-1, 0, 0, -1)
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
spacerItem4 = QtWidgets.QSpacerItem(250, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_6.addItem(spacerItem4)
self.pushButton = QtWidgets.QPushButton(self.page_3)
font = QtGui.QFont()
font.setPointSize(10)
self.pushButton.setFont(font)
self.pushButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton.setObjectName("pushButton")
self.horizontalLayout_6.addWidget(self.pushButton)
self.gridLayout_2.addLayout(self.horizontalLayout_6, 16, 1, 1, 1)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem5)
self.Buton_mask = QtWidgets.QPushButton(self.page_3)
font = QtGui.QFont()
font.setPointSize(11)
self.Buton_mask.setFont(font)
self.Buton_mask.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.Buton_mask.setObjectName("Buton_mask")
self.horizontalLayout.addWidget(self.Buton_mask)
self.gridLayout_2.addLayout(self.horizontalLayout, 5, 1, 1, 1)
self.Start = QtWidgets.QPushButton(self.page_3)
font = QtGui.QFont()
font.setPointSize(11)
self.Start.setFont(font)
self.Start.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.Start.setObjectName("Start")
self.gridLayout_2.addWidget(self.Start, 12, 1, 1, 1)
spacerItem6 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_2.addItem(spacerItem6, 15, 0, 1, 1)
self.label = QtWidgets.QLabel(self.page_3)
self.label.setMinimumSize(QtCore.QSize(200, 0))
font = QtGui.QFont()
font.setPointSize(11)
self.label.setFont(font)
self.label.setObjectName("label")
self.gridLayout_2.addWidget(self.label, 3, 0, 1, 1)
spacerItem7 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_2.addItem(spacerItem7, 4, 0, 1, 1)
spacerItem8 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_2.addItem(spacerItem8, 6, 0, 1, 1)
self.lineEdit_json = QtWidgets.QLineEdit(self.page_3)
self.lineEdit_json.setMinimumSize(QtCore.QSize(0, 30))
self.lineEdit_json.setObjectName("lineEdit_json")
self.gridLayout_2.addWidget(self.lineEdit_json, 7, 1, 1, 1)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
spacerItem9 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem9)
self.Buton_json = QtWidgets.QPushButton(self.page_3)
font = QtGui.QFont()
font.setPointSize(11)
self.Buton_json.setFont(font)
self.Buton_json.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.Buton_json.setObjectName("Buton_json")
self.horizontalLayout_2.addWidget(self.Buton_json)
self.gridLayout_2.addLayout(self.horizontalLayout_2, 9, 1, 1, 1)
spacerItem10 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_2.addItem(spacerItem10, 11, 0, 1, 1)
self.lineEdit_mask = QtWidgets.QLineEdit(self.page_3)
self.lineEdit_mask.setMinimumSize(QtCore.QSize(0, 30))
self.lineEdit_mask.setObjectName("lineEdit_mask")
self.gridLayout_2.addWidget(self.lineEdit_mask, 3, 1, 1, 1)
self.horizontalLayout_11 = QtWidgets.QHBoxLayout()
self.horizontalLayout_11.setContentsMargins(-1, 0, -1, -1)
self.horizontalLayout_11.setObjectName("horizontalLayout_11")
self.label_8 = QtWidgets.QLabel(self.page_3)
self.label_8.setMinimumSize(QtCore.QSize(0, 32))
font = QtGui.QFont()
font.setFamily("Yu Gothic UI Semibold")
font.setPointSize(12)
self.label_8.setFont(font)
self.label_8.setAlignment(QtCore.Qt.AlignCenter)
self.label_8.setObjectName("label_8")
self.horizontalLayout_11.addWidget(self.label_8)
self.gridLayout_2.addLayout(self.horizontalLayout_11, 1, 1, 1, 1)
self.gridLayout_3.addLayout(self.gridLayout_2, 1, 0, 1, 1)
self.stackedWidget.addWidget(self.page_3)
self.page_4 = QtWidgets.QWidget()
self.page_4.setObjectName("page_4")
self.gridLayout_5 = QtWidgets.QGridLayout(self.page_4)
self.gridLayout_5.setContentsMargins(0, 0, 0, 0)
self.gridLayout_5.setObjectName("gridLayout_5")
self.gridLayout_4 = QtWidgets.QGridLayout()
self.gridLayout_4.setObjectName("gridLayout_4")
self.pushButton_baslat = QtWidgets.QPushButton(self.page_4)
font = QtGui.QFont()
font.setPointSize(11)
self.pushButton_baslat.setFont(font)
self.pushButton_baslat.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_baslat.setObjectName("pushButton_baslat")
self.gridLayout_4.addWidget(self.pushButton_baslat, 11, 1, 1, 1)
spacerItem11 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_4.addItem(spacerItem11, 2, 0, 1, 1)
self.label_5 = QtWidgets.QLabel(self.page_4)
font = QtGui.QFont()
font.setPointSize(10)
self.label_5.setFont(font)
self.label_5.setObjectName("label_5")
self.gridLayout_4.addWidget(self.label_5, 7, 0, 1, 1)
self.label_4 = QtWidgets.QLabel(self.page_4)
font = QtGui.QFont()
font.setPointSize(11)
self.label_4.setFont(font)
self.label_4.setObjectName("label_4")
self.gridLayout_4.addWidget(self.label_4, 5, 0, 1, 1)
spacerItem12 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_4.addItem(spacerItem12, 8, 0, 1, 1)
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.lineEdit_height = QtWidgets.QLineEdit(self.page_4)
font = QtGui.QFont()
font.setPointSize(10)
self.lineEdit_height.setFont(font)
self.lineEdit_height.setMouseTracking(True)
self.lineEdit_height.setToolTipDuration(-3)
self.lineEdit_height.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_height.setObjectName("lineEdit_height")
self.horizontalLayout_4.addWidget(self.lineEdit_height)
spacerItem13 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem13)
self.gridLayout_4.addLayout(self.horizontalLayout_4, 9, 1, 1, 1)
self.pushButton_masktojson = QtWidgets.QPushButton(self.page_4)
font = QtGui.QFont()
font.setPointSize(10)
self.pushButton_masktojson.setFont(font)
self.pushButton_masktojson.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_masktojson.setObjectName("pushButton_masktojson")
self.gridLayout_4.addWidget(self.pushButton_masktojson, 14, 0, 1, 1)
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.pushButton_loadjson = QtWidgets.QPushButton(self.page_4)
font = QtGui.QFont()
font.setPointSize(10)
self.pushButton_loadjson.setFont(font)
self.pushButton_loadjson.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_loadjson.setText("")
self.pushButton_loadjson.setObjectName("pushButton_loadjson")
self.horizontalLayout_5.addWidget(self.pushButton_loadjson)
self.gridLayout_4.addLayout(self.horizontalLayout_5, 3, 1, 1, 1)
spacerItem14 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_4.addItem(spacerItem14, 6, 0, 1, 1)
self.label_6 = QtWidgets.QLabel(self.page_4)
font = QtGui.QFont()
font.setPointSize(10)
self.label_6.setFont(font)
self.label_6.setObjectName("label_6")
self.gridLayout_4.addWidget(self.label_6, 9, 0, 1, 1)
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.lineEdit_widht = QtWidgets.QLineEdit(self.page_4)
font = QtGui.QFont()
font.setPointSize(10)
self.lineEdit_widht.setFont(font)
self.lineEdit_widht.setMouseTracking(True)
self.lineEdit_widht.setToolTipDuration(-3)
self.lineEdit_widht.setStatusTip("")
self.lineEdit_widht.setWhatsThis("")
self.lineEdit_widht.setAccessibleName("")
self.lineEdit_widht.setAccessibleDescription("")
self.lineEdit_widht.setText("")
self.lineEdit_widht.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_widht.setObjectName("lineEdit_widht")
self.horizontalLayout_3.addWidget(self.lineEdit_widht)
spacerItem15 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(spacerItem15)
self.gridLayout_4.addLayout(self.horizontalLayout_3, 7, 1, 1, 1)
self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
self.pushButton_maskpath = QtWidgets.QPushButton(self.page_4)
font = QtGui.QFont()
font.setPointSize(10)
self.pushButton_maskpath.setFont(font)
self.pushButton_maskpath.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_maskpath.setText("")
self.pushButton_maskpath.setObjectName("pushButton_maskpath")
self.horizontalLayout_7.addWidget(self.pushButton_maskpath)
self.gridLayout_4.addLayout(self.horizontalLayout_7, 5, 1, 1, 1)
spacerItem16 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_4.addItem(spacerItem16, 14, 1, 1, 1)
spacerItem17 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_4.addItem(spacerItem17, 0, 0, 1, 1)
spacerItem18 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_4.addItem(spacerItem18, 12, 1, 1, 1)
self.label_3 = QtWidgets.QLabel(self.page_4)
font = QtGui.QFont()
font.setPointSize(11)
self.label_3.setFont(font)
self.label_3.setObjectName("label_3")
self.gridLayout_4.addWidget(self.label_3, 3, 0, 1, 1)
spacerItem19 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_4.addItem(spacerItem19, 10, 0, 1, 1)
self.progressBar = QtWidgets.QProgressBar(self.page_4)
self.progressBar.setProperty("value", 0)
self.progressBar.setObjectName("progressBar")
self.gridLayout_4.addWidget(self.progressBar, 13, 1, 1, 1)
spacerItem20 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_4.addItem(spacerItem20, 4, 0, 1, 1)
self.horizontalLayout_8 = QtWidgets.QHBoxLayout()
self.horizontalLayout_8.setContentsMargins(-1, 0, -1, -1)
self.horizontalLayout_8.setObjectName("horizontalLayout_8")
self.label_7 = QtWidgets.QLabel(self.page_4)
self.label_7.setMinimumSize(QtCore.QSize(0, 32))
font = QtGui.QFont()
font.setFamily("Yu Gothic UI Semibold")
font.setPointSize(12)
self.label_7.setFont(font)
self.label_7.setAlignment(QtCore.Qt.AlignCenter)
self.label_7.setObjectName("label_7")
self.horizontalLayout_8.addWidget(self.label_7)
self.gridLayout_4.addLayout(self.horizontalLayout_8, 1, 1, 1, 1)
self.gridLayout_5.addLayout(self.gridLayout_4, 0, 0, 1, 1)
self.stackedWidget.addWidget(self.page_4)
self.gridLayout.addWidget(self.stackedWidget, 0, 0, 1, 1)
converter.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(converter)
self.menubar.setGeometry(QtCore.QRect(0, 0, 700, 26))
self.menubar.setObjectName("menubar")
self.menuMod_ller = QtWidgets.QMenu(self.menubar)
self.menuMod_ller.setObjectName("menuMod_ller")
converter.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(converter)
self.statusbar.setObjectName("statusbar")
converter.setStatusBar(self.statusbar)
self.actionMask_to_JSON = QtWidgets.QAction(converter)
self.actionMask_to_JSON.setObjectName("actionMask_to_JSON")
self.actionJSON_to_Mask = QtWidgets.QAction(converter)
self.actionJSON_to_Mask.setObjectName("actionJSON_to_Mask")
self.menuMod_ller.addAction(self.actionMask_to_JSON)
self.menuMod_ller.addAction(self.actionJSON_to_Mask)
self.menubar.addAction(self.menuMod_ller.menuAction())
self.retranslateUi(converter)
self.stackedWidget.setCurrentIndex(1)
QtCore.QMetaObject.connectSlotsByName(converter)
def retranslateUi(self, converter):
_translate = QtCore.QCoreApplication.translate
converter.setWindowTitle(_translate("converter", "Converter"))
self.label_2.setText(_translate("converter", "JSON Path"))
self.pushButton.setText(_translate("converter", "JSON to Mask >>"))
self.Buton_mask.setText(_translate("converter", "Add"))
self.Start.setText(_translate("converter", "Start"))
self.label.setText(_translate("converter", "Mask Path"))
self.Buton_json.setText(_translate("converter", "Add"))
self.label_8.setText(_translate("converter", "Convert Mask to Json"))
self.pushButton_baslat.setText(_translate("converter", "Start"))
self.label_5.setText(_translate("converter", "MASK HEIGHT :"))
self.label_4.setText(_translate("converter", "Choose Save Mask Path :"))
self.lineEdit_height.setToolTip(_translate("converter", "set mask height"))
self.pushButton_masktojson.setText(_translate("converter", "<< Mask to Json"))
self.label_6.setText(_translate("converter", "MASK WIDTH :"))
self.lineEdit_widht.setToolTip(_translate("converter", "set mask width"))
self.label_3.setText(_translate("converter", "Load Json :"))
self.label_7.setText(_translate("converter", "Convert Json to Mask"))
self.menuMod_ller.setTitle(_translate("converter", "Modüller"))
self.actionMask_to_JSON.setText(_translate("converter", "Mask to JSON"))
self.actionJSON_to_Mask.setText(_translate("converter", "JSON to Mask"))
import icon_rc