Skip to content

Commit ad14623

Browse files
committed
Rename 'Generated Files' to 'Output Folder' and add relevant check in check_profile
1 parent 3821077 commit ad14623

File tree

6 files changed

+91
-81
lines changed

6 files changed

+91
-81
lines changed

launcher/controllers/docker_ctrl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def start_new_cpu_server(self, image, config_file):
199199
source=get_system_path(self.model.profile["paired_path"]),
200200
type="bind"),
201201
docker.types.Mount(target="/Robustar2/generated",
202-
source=get_system_path(self.model.profile["gen_path"]),
202+
source=get_system_path(self.model.profile["out_path"]),
203203
type="bind"),
204204
docker.types.Mount(target="/Robustar2/influence_images",
205205
source=get_system_path(self.model.profile["inf_path"]),
@@ -238,7 +238,7 @@ def start_new_cuda_server(self, image, config_file):
238238
source=get_system_path(self.model.profile["paired_path"]),
239239
type="bind"),
240240
docker.types.Mount(target="/Robustar2/generated",
241-
source=get_system_path(self.model.profile["gen_path"]),
241+
source=get_system_path(self.model.profile["out_path"]),
242242
type="bind"),
243243
docker.types.Mount(target="/Robustar2/influence_images",
244244
source=get_system_path(self.model.profile["inf_path"]),

launcher/controllers/main_ctrl.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ def set_m_paired_path(self):
8888
if path:
8989
self.model.paired_path = path
9090

91-
def set_m_gen_path(self):
91+
def set_m_out_path(self):
9292
path = QFileDialog.getExistingDirectory(
93-
self.main_view, "Choose Generated Files Path", self.model.cwd
93+
self.main_view, "Choose Output Folder Path", self.model.cwd
9494
)
9595
self.model.cwd = os.path.dirname(path)
9696
if path:
97-
self.model.gen_path = path
97+
self.model.out_path = path
9898

9999
def set_m_ckpt_path(self):
100100
path = QFileDialog.getExistingDirectory(
@@ -219,8 +219,8 @@ def set_v_test_path(self, val):
219219
def set_v_paired_path(self, val):
220220
self.main_view.ui.paired_line_edit.setText(val)
221221

222-
def set_v_gen_path(self, val):
223-
self.main_view.ui.gen_line_edit.setText(val)
222+
def set_v_out_path(self, val):
223+
self.main_view.ui.out_line_edit.setText(val)
224224

225225
def set_v_ckpt_path(self, val):
226226
self.main_view.ui.ckpt_line_edit.setText(val)
@@ -277,28 +277,38 @@ def disable_control(self):
277277

278278
def check_profile(self):
279279
miss_profile_dict = {
280+
"name": "container name",
281+
"port": "port",
280282
"train_path": "train set path",
281283
"val_path": "validation set path",
282284
"test_path": "test set path",
285+
"paired_path": "paired set path",
286+
"out_path": "output folder path",
283287
"inf_path": "influence result path",
284288
"ckpt_path": "check point path",
285289
"batch": "batch size",
286290
"worker": "worker number",
287291
"cls": "class number",
288292
"size": "image size",
293+
"device": "device"
289294
}
290295
miss_profile_prompt = []
291296

292297
for profile_name in [
298+
"name",
299+
"port",
293300
"train_path",
294301
"val_path",
295302
"test_path",
303+
"paired_path",
304+
"out_path",
296305
"inf_path",
297306
"ckpt_path",
298307
"batch",
299308
"worker",
300309
"cls",
301310
"size",
311+
"device"
302312
]:
303313
if not self.model.profile[profile_name].strip():
304314
miss_profile_prompt.append(miss_profile_dict[profile_name])

launcher/model/model.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Model(QObject):
1010
valPathChanged = Signal(str)
1111
testPathChanged = Signal(str)
1212
pairedPathChanged = Signal(str)
13-
genPathChanged = Signal(str)
13+
outPathChanged = Signal(str)
1414
ckptPathChanged = Signal(str)
1515
infPathChanged = Signal(str)
1616
archChanged = Signal(str)
@@ -38,7 +38,7 @@ def __init__(self, ctrl):
3838
"val_path": "",
3939
"test_path": "",
4040
"paired_path": "",
41-
"gen_path": "",
41+
"out_path": "",
4242
"ckpt_path": "",
4343
"inf_path": "",
4444
"arch": "resnet-18",
@@ -79,7 +79,7 @@ def __init__(self, ctrl):
7979
self.trainPathChanged.connect(self.ctrl.set_v_train_path)
8080
self.valPathChanged.connect(self.ctrl.set_v_val_path)
8181
self.pairedPathChanged.connect(self.ctrl.set_v_paired_path)
82-
self.genPathChanged.connect(self.ctrl.set_v_gen_path)
82+
self.outPathChanged.connect(self.ctrl.set_v_out_path)
8383
self.testPathChanged.connect(self.ctrl.set_v_test_path)
8484
self.ckptPathChanged.connect(self.ctrl.set_v_ckpt_path)
8585
self.infPathChanged.connect(self.ctrl.set_v_inf_path)
@@ -158,13 +158,13 @@ def paired_path(self, val):
158158
self.pairedPathChanged.emit(val)
159159

160160
@property
161-
def gen_path(self):
162-
return self._profile['gen_path']
161+
def out_path(self):
162+
return self._profile['out_path']
163163

164-
@gen_path.setter
165-
def gen_path(self, val):
166-
self._profile['gen_path'] = val
167-
self.genPathChanged.emit(val)
164+
@out_path.setter
165+
def out_path(self, val):
166+
self._profile['out_path'] = val
167+
self.outPathChanged.emit(val)
168168

169169
@property
170170
def ckpt_path(self):
@@ -287,7 +287,7 @@ def profile(self, val):
287287
self.val_path = val["val_path"]
288288
self.test_path = val["test_path"]
289289
self.paired_path = val["paired_path"]
290-
self.gen_path = val["gen_path"]
290+
self.out_path = val["out_path"]
291291
self.ckpt_path = val["ckpt_path"]
292292
self.inf_path = val["inf_path"]
293293
self.arch = val["arch"]

launcher/resources/launcher_v2.ui

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,12 +1368,9 @@ QPushButton:hover {
13681368
</layout>
13691369
</item>
13701370
<item>
1371-
<layout class="QHBoxLayout" name="gen_h_layout">
1372-
<property name="rightMargin">
1373-
<number>0</number>
1374-
</property>
1371+
<layout class="QHBoxLayout" name="ckpt_h_layout">
13751372
<item>
1376-
<widget class="QLabel" name="gen_label">
1373+
<widget class="QLabel" name="ckpt_label">
13771374
<property name="sizePolicy">
13781375
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
13791376
<horstretch>0</horstretch>
@@ -1402,15 +1399,15 @@ QPushButton:hover {
14021399
</font>
14031400
</property>
14041401
<property name="toolTip">
1405-
<string>The root path of the generated files</string>
1402+
<string>The root path for all checkpoint files saved by Robustar</string>
14061403
</property>
14071404
<property name="text">
1408-
<string>Generated Set</string>
1405+
<string>Checkpoint</string>
14091406
</property>
14101407
</widget>
14111408
</item>
14121409
<item>
1413-
<widget class="QLineEdit" name="gen_line_edit">
1410+
<widget class="QLineEdit" name="ckpt_line_edit">
14141411
<property name="sizePolicy">
14151412
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
14161413
<horstretch>0</horstretch>
@@ -1444,7 +1441,7 @@ QPushButton:hover {
14441441
</widget>
14451442
</item>
14461443
<item>
1447-
<widget class="QPushButton" name="gen_push_button">
1444+
<widget class="QPushButton" name="ckpt_push_button">
14481445
<property name="sizePolicy">
14491446
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
14501447
<horstretch>0</horstretch>
@@ -1480,9 +1477,9 @@ QPushButton:hover {
14801477
</layout>
14811478
</item>
14821479
<item>
1483-
<layout class="QHBoxLayout" name="ckpt_h_layout">
1480+
<layout class="QHBoxLayout" name="inf_h_layout">
14841481
<item>
1485-
<widget class="QLabel" name="ckpt_label">
1482+
<widget class="QLabel" name="inf_label">
14861483
<property name="sizePolicy">
14871484
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
14881485
<horstretch>0</horstretch>
@@ -1511,15 +1508,15 @@ QPushButton:hover {
15111508
</font>
15121509
</property>
15131510
<property name="toolTip">
1514-
<string>The root path for all checkpoint files saved by Robustar</string>
1511+
<string>The root path for all influence result calculated by Robustar</string>
15151512
</property>
15161513
<property name="text">
1517-
<string>Checkpoint</string>
1514+
<string>Influence Result</string>
15181515
</property>
15191516
</widget>
15201517
</item>
15211518
<item>
1522-
<widget class="QLineEdit" name="ckpt_line_edit">
1519+
<widget class="QLineEdit" name="inf_line_edit">
15231520
<property name="sizePolicy">
15241521
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
15251522
<horstretch>0</horstretch>
@@ -1553,7 +1550,7 @@ QPushButton:hover {
15531550
</widget>
15541551
</item>
15551552
<item>
1556-
<widget class="QPushButton" name="ckpt_push_button">
1553+
<widget class="QPushButton" name="inf_push_button">
15571554
<property name="sizePolicy">
15581555
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
15591556
<horstretch>0</horstretch>
@@ -1589,9 +1586,12 @@ QPushButton:hover {
15891586
</layout>
15901587
</item>
15911588
<item>
1592-
<layout class="QHBoxLayout" name="inf_h_layout">
1589+
<layout class="QHBoxLayout" name="out_h_layout">
1590+
<property name="rightMargin">
1591+
<number>0</number>
1592+
</property>
15931593
<item>
1594-
<widget class="QLabel" name="inf_label">
1594+
<widget class="QLabel" name="out_label">
15951595
<property name="sizePolicy">
15961596
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
15971597
<horstretch>0</horstretch>
@@ -1620,15 +1620,15 @@ QPushButton:hover {
16201620
</font>
16211621
</property>
16221622
<property name="toolTip">
1623-
<string>The root path for all influence result calculated by Robustar</string>
1623+
<string>The root path of the generated files</string>
16241624
</property>
16251625
<property name="text">
1626-
<string>Influence Result</string>
1626+
<string>Output Folder</string>
16271627
</property>
16281628
</widget>
16291629
</item>
16301630
<item>
1631-
<widget class="QLineEdit" name="inf_line_edit">
1631+
<widget class="QLineEdit" name="out_line_edit">
16321632
<property name="sizePolicy">
16331633
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
16341634
<horstretch>0</horstretch>
@@ -1662,7 +1662,7 @@ QPushButton:hover {
16621662
</widget>
16631663
</item>
16641664
<item>
1665-
<widget class="QPushButton" name="inf_push_button">
1665+
<widget class="QPushButton" name="out_push_button">
16661666
<property name="sizePolicy">
16671667
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
16681668
<horstretch>0</horstretch>

launcher/views/main_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, ctrl):
1818
self.ui.val_push_button.clicked.connect(self.ctrl.set_m_val_path)
1919
self.ui.test_push_button.clicked.connect(self.ctrl.set_m_test_path)
2020
self.ui.paired_push_button.clicked.connect(self.ctrl.set_m_paired_path)
21-
self.ui.gen_push_button.clicked.connect(self.ctrl.set_m_gen_path)
21+
self.ui.out_push_button.clicked.connect(self.ctrl.set_m_out_path)
2222
self.ui.ckpt_push_button.clicked.connect(self.ctrl.set_m_ckpt_path)
2323
self.ui.inf_push_button.clicked.connect(self.ctrl.set_m_inf_path)
2424

launcher/views/main_view_ui.py

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -502,42 +502,6 @@ def setupUi(self, main_widget):
502502

503503
self.data_v_layout.addLayout(self.paired_h_layout)
504504

505-
self.gen_h_layout = QHBoxLayout()
506-
self.gen_h_layout.setObjectName(u"gen_h_layout")
507-
self.gen_h_layout.setContentsMargins(-1, -1, 0, -1)
508-
self.gen_label = QLabel(self.layoutWidget4)
509-
self.gen_label.setObjectName(u"gen_label")
510-
sizePolicy1.setHeightForWidth(self.gen_label.sizePolicy().hasHeightForWidth())
511-
self.gen_label.setSizePolicy(sizePolicy1)
512-
self.gen_label.setMinimumSize(QSize(174, 39))
513-
self.gen_label.setMaximumSize(QSize(174, 39))
514-
self.gen_label.setFont(font)
515-
516-
self.gen_h_layout.addWidget(self.gen_label)
517-
518-
self.gen_line_edit = QLineEdit(self.layoutWidget4)
519-
self.gen_line_edit.setObjectName(u"gen_line_edit")
520-
sizePolicy1.setHeightForWidth(self.gen_line_edit.sizePolicy().hasHeightForWidth())
521-
self.gen_line_edit.setSizePolicy(sizePolicy1)
522-
self.gen_line_edit.setMinimumSize(QSize(137, 24))
523-
self.gen_line_edit.setMaximumSize(QSize(137, 24))
524-
self.gen_line_edit.setFont(font)
525-
526-
self.gen_h_layout.addWidget(self.gen_line_edit)
527-
528-
self.gen_push_button = QPushButton(self.layoutWidget4)
529-
self.gen_push_button.setObjectName(u"gen_push_button")
530-
sizePolicy1.setHeightForWidth(self.gen_push_button.sizePolicy().hasHeightForWidth())
531-
self.gen_push_button.setSizePolicy(sizePolicy1)
532-
self.gen_push_button.setMinimumSize(QSize(28, 20))
533-
self.gen_push_button.setMaximumSize(QSize(28, 20))
534-
self.gen_push_button.setFont(font)
535-
536-
self.gen_h_layout.addWidget(self.gen_push_button)
537-
538-
539-
self.data_v_layout.addLayout(self.gen_h_layout)
540-
541505
self.ckpt_h_layout = QHBoxLayout()
542506
self.ckpt_h_layout.setObjectName(u"ckpt_h_layout")
543507
self.ckpt_label = QLabel(self.layoutWidget4)
@@ -608,6 +572,42 @@ def setupUi(self, main_widget):
608572

609573
self.data_v_layout.addLayout(self.inf_h_layout)
610574

575+
self.out_h_layout = QHBoxLayout()
576+
self.out_h_layout.setObjectName(u"out_h_layout")
577+
self.out_h_layout.setContentsMargins(-1, -1, 0, -1)
578+
self.out_label = QLabel(self.layoutWidget4)
579+
self.out_label.setObjectName(u"out_label")
580+
sizePolicy1.setHeightForWidth(self.out_label.sizePolicy().hasHeightForWidth())
581+
self.out_label.setSizePolicy(sizePolicy1)
582+
self.out_label.setMinimumSize(QSize(174, 39))
583+
self.out_label.setMaximumSize(QSize(174, 39))
584+
self.out_label.setFont(font)
585+
586+
self.out_h_layout.addWidget(self.out_label)
587+
588+
self.out_line_edit = QLineEdit(self.layoutWidget4)
589+
self.out_line_edit.setObjectName(u"out_line_edit")
590+
sizePolicy1.setHeightForWidth(self.out_line_edit.sizePolicy().hasHeightForWidth())
591+
self.out_line_edit.setSizePolicy(sizePolicy1)
592+
self.out_line_edit.setMinimumSize(QSize(137, 24))
593+
self.out_line_edit.setMaximumSize(QSize(137, 24))
594+
self.out_line_edit.setFont(font)
595+
596+
self.out_h_layout.addWidget(self.out_line_edit)
597+
598+
self.out_push_button = QPushButton(self.layoutWidget4)
599+
self.out_push_button.setObjectName(u"out_push_button")
600+
sizePolicy1.setHeightForWidth(self.out_push_button.sizePolicy().hasHeightForWidth())
601+
self.out_push_button.setSizePolicy(sizePolicy1)
602+
self.out_push_button.setMinimumSize(QSize(28, 20))
603+
self.out_push_button.setMaximumSize(QSize(28, 20))
604+
self.out_push_button.setFont(font)
605+
606+
self.out_h_layout.addWidget(self.out_push_button)
607+
608+
609+
self.data_v_layout.addLayout(self.out_h_layout)
610+
611611

612612
self.docker_data_v_layout.addWidget(self.data_group_box)
613613

@@ -1083,12 +1083,6 @@ def retranslateUi(self, main_widget):
10831083
self.paired_label.setText(QCoreApplication.translate("main_widget", u"Paired Set", None))
10841084
self.paired_line_edit.setText("")
10851085
self.paired_push_button.setText(QCoreApplication.translate("main_widget", u"...", None))
1086-
#if QT_CONFIG(tooltip)
1087-
self.gen_label.setToolTip(QCoreApplication.translate("main_widget", u"The root path of the generated files", None))
1088-
#endif // QT_CONFIG(tooltip)
1089-
self.gen_label.setText(QCoreApplication.translate("main_widget", u"Generated Set", None))
1090-
self.gen_line_edit.setText("")
1091-
self.gen_push_button.setText(QCoreApplication.translate("main_widget", u"...", None))
10921086
#if QT_CONFIG(tooltip)
10931087
self.ckpt_label.setToolTip(QCoreApplication.translate("main_widget", u"The root path for all checkpoint files saved by Robustar", None))
10941088
#endif // QT_CONFIG(tooltip)
@@ -1101,6 +1095,12 @@ def retranslateUi(self, main_widget):
11011095
self.inf_label.setText(QCoreApplication.translate("main_widget", u"Influence Result", None))
11021096
self.inf_line_edit.setText("")
11031097
self.inf_push_button.setText(QCoreApplication.translate("main_widget", u"...", None))
1098+
#if QT_CONFIG(tooltip)
1099+
self.out_label.setToolTip(QCoreApplication.translate("main_widget", u"The root path of the generated files", None))
1100+
#endif // QT_CONFIG(tooltip)
1101+
self.out_label.setText(QCoreApplication.translate("main_widget", u"Output Folder", None))
1102+
self.out_line_edit.setText("")
1103+
self.out_push_button.setText(QCoreApplication.translate("main_widget", u"...", None))
11041104
self.model_group_box.setTitle(QCoreApplication.translate("main_widget", u"Model", None))
11051105
#if QT_CONFIG(tooltip)
11061106
self.arch_label.setToolTip(QCoreApplication.translate("main_widget", u"The architecture of the model", None))

0 commit comments

Comments
 (0)