Skip to content

Commit 49fd4c0

Browse files
committed
Hide model related variables when a pretrained model has been selected
1 parent 68cb9d3 commit 49fd4c0

File tree

4 files changed

+125
-72
lines changed

4 files changed

+125
-72
lines changed

main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,10 @@ def __init__(self, logger, log_dir):
294294
["MODEL__SOURCE__LABEL","MODEL__SOURCE__INFO","MODEL__SOURCE__INPUT",
295295
"checkpoint_file_path_browse_label", "PATHS__CHECKPOINT_FILE__INFO","PATHS__CHECKPOINT_FILE__INPUT","checkpoint_file_path_browse_bn",
296296
"checkpoint_loading_opt_label", "checkpoint_loading_opt_frame",
297-
"MODEL__BMZ__SOURCE_MODEL_ID__LABEL","MODEL__BMZ__SOURCE_MODEL_ID__INFO","MODEL__BMZ__SOURCE_MODEL_ID__INPUT","MODEL__BMZ__SOURCE_MODEL_ID__BN"]
297+
"MODEL__BMZ__SOURCE_MODEL_ID__LABEL","MODEL__BMZ__SOURCE_MODEL_ID__INFO","MODEL__BMZ__SOURCE_MODEL_ID__INPUT","MODEL__BMZ__SOURCE_MODEL_ID__BN",
298+
"MODEL__ARCHITECTURE__LABEL", "MODEL__ARCHITECTURE__INFO", "MODEL__ARCHITECTURE__INPUT",
299+
"unet_model_like_frame", "unet_model_like_label","transformers_frame", "transformers_label",
300+
"convnext_label", "convnext_frame"]
298301
, widgets_to_set_cond=
299302
[
300303
(["MODEL__BMZ__EXPORT__REUSE_BMZ_CONFIG__INPUT", "No"], ["No"])
@@ -316,7 +319,6 @@ def __init__(self, logger, log_dir):
316319
["MODEL__BMZ__EXPORT__FRAME"]))
317320

318321

319-
320322
self.ui.job_name_input.textChanged.connect(lambda: mark_syntax_error(self, "job_name_input", ["empty"]))
321323
self.ui.goptions_yaml_name_input.textChanged.connect(lambda: mark_syntax_error(self, "goptions_yaml_name_input", ["empty"]))
322324
self.ui.goptions_browse_yaml_path_input.textChanged.connect(lambda: mark_syntax_error(self, "goptions_browse_yaml_path_input", ["empty"]))

ui/ui_main.py

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ def setupUi(self, MainWindow):
13721372
self.scrollArea_17.setWidgetResizable(True)
13731373
self.scrollAreaWidgetContents_22 = QWidget()
13741374
self.scrollAreaWidgetContents_22.setObjectName(u"scrollAreaWidgetContents_22")
1375-
self.scrollAreaWidgetContents_22.setGeometry(QRect(0, 0, 587, 509))
1375+
self.scrollAreaWidgetContents_22.setGeometry(QRect(0, 0, 587, 304))
13761376
self.verticalLayout_59 = QVBoxLayout(self.scrollAreaWidgetContents_22)
13771377
self.verticalLayout_59.setSpacing(6)
13781378
self.verticalLayout_59.setObjectName(u"verticalLayout_59")
@@ -2485,7 +2485,7 @@ def setupUi(self, MainWindow):
24852485
self.goptions_scrollArea.setWidgetResizable(True)
24862486
self.scrollAreaWidgetContents = QWidget()
24872487
self.scrollAreaWidgetContents.setObjectName(u"scrollAreaWidgetContents")
2488-
self.scrollAreaWidgetContents.setGeometry(QRect(0, -521, 928, 1686))
2488+
self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 928, 983))
24892489
self.scrollAreaWidgetContents.setLayoutDirection(Qt.LeftToRight)
24902490
self.gridLayout = QGridLayout(self.scrollAreaWidgetContents)
24912491
self.gridLayout.setObjectName(u"gridLayout")
@@ -2607,7 +2607,7 @@ def setupUi(self, MainWindow):
26072607
self.goptions_advanced_options_scrollarea.setWidgetResizable(True)
26082608
self.scrollAreaWidgetContents_2 = QWidget()
26092609
self.scrollAreaWidgetContents_2.setObjectName(u"scrollAreaWidgetContents_2")
2610-
self.scrollAreaWidgetContents_2.setGeometry(QRect(0, 0, 851, 549))
2610+
self.scrollAreaWidgetContents_2.setGeometry(QRect(0, 0, 851, 288))
26112611
self.gridLayout_2 = QGridLayout(self.scrollAreaWidgetContents_2)
26122612
self.gridLayout_2.setObjectName(u"gridLayout_2")
26132613
self.label = QLabel(self.scrollAreaWidgetContents_2)
@@ -3394,7 +3394,7 @@ def setupUi(self, MainWindow):
33943394
self.train_scrollArea.setWidgetResizable(True)
33953395
self.scrollAreaWidgetContents_3 = QWidget()
33963396
self.scrollAreaWidgetContents_3.setObjectName(u"scrollAreaWidgetContents_3")
3397-
self.scrollAreaWidgetContents_3.setGeometry(QRect(0, -3309, 938, 16190))
3397+
self.scrollAreaWidgetContents_3.setGeometry(QRect(0, 0, 905, 7914))
33983398
self.scrollAreaWidgetContents_3.setLayoutDirection(Qt.LeftToRight)
33993399
self.gridLayout_3 = QGridLayout(self.scrollAreaWidgetContents_3)
34003400
self.gridLayout_3.setObjectName(u"gridLayout_3")
@@ -7967,12 +7967,12 @@ def setupUi(self, MainWindow):
79677967

79687968
self.gridLayout_13.addWidget(self.TRAIN__EPOCHS__INPUT, 1, 2, 1, 1)
79697969

7970-
self.label_34 = QLabel(self.frame_12)
7971-
self.label_34.setObjectName(u"label_34")
7972-
self.label_34.setMaximumSize(QSize(16777215, 16777215))
7973-
self.label_34.setFont(font)
7970+
self.MODEL__ARCHITECTURE__LABEL = QLabel(self.frame_12)
7971+
self.MODEL__ARCHITECTURE__LABEL.setObjectName(u"MODEL__ARCHITECTURE__LABEL")
7972+
self.MODEL__ARCHITECTURE__LABEL.setMaximumSize(QSize(16777215, 16777215))
7973+
self.MODEL__ARCHITECTURE__LABEL.setFont(font)
79747974

7975-
self.gridLayout_13.addWidget(self.label_34, 4, 0, 1, 1)
7975+
self.gridLayout_13.addWidget(self.MODEL__ARCHITECTURE__LABEL, 4, 0, 1, 1)
79767976

79777977
self.patience_info = QPushButton(self.frame_12)
79787978
self.patience_info.setObjectName(u"patience_info")
@@ -8026,7 +8026,7 @@ def setupUi(self, MainWindow):
80268026

80278027
self.horizontalSpacer_6 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
80288028

8029-
self.gridLayout_13.addItem(self.horizontalSpacer_6, 4, 3, 1, 1)
8029+
self.gridLayout_13.addItem(self.horizontalSpacer_6, 2, 3, 1, 1)
80308030

80318031

80328032
self.gridLayout_4.addWidget(self.frame_12, 7, 0, 1, 1)
@@ -9054,7 +9054,7 @@ def setupUi(self, MainWindow):
90549054
self.scrollArea.setWidgetResizable(True)
90559055
self.scrollAreaWidgetContents_6 = QWidget()
90569056
self.scrollAreaWidgetContents_6.setObjectName(u"scrollAreaWidgetContents_6")
9057-
self.scrollAreaWidgetContents_6.setGeometry(QRect(0, 0, 579, 698))
9057+
self.scrollAreaWidgetContents_6.setGeometry(QRect(0, 0, 544, 375))
90589058
self.gridLayout_18 = QGridLayout(self.scrollAreaWidgetContents_6)
90599059
self.gridLayout_18.setObjectName(u"gridLayout_18")
90609060
self.verticalSpacer_8 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
@@ -9307,7 +9307,7 @@ def setupUi(self, MainWindow):
93079307
self.scrollArea_2.setWidgetResizable(True)
93089308
self.scrollAreaWidgetContents_4 = QWidget()
93099309
self.scrollAreaWidgetContents_4.setObjectName(u"scrollAreaWidgetContents_4")
9310-
self.scrollAreaWidgetContents_4.setGeometry(QRect(0, 0, 893, 319))
9310+
self.scrollAreaWidgetContents_4.setGeometry(QRect(0, 0, 865, 181))
93119311
self.gridLayout_17 = QGridLayout(self.scrollAreaWidgetContents_4)
93129312
self.gridLayout_17.setObjectName(u"gridLayout_17")
93139313
self.label_59 = QLabel(self.scrollAreaWidgetContents_4)
@@ -9516,7 +9516,7 @@ def setupUi(self, MainWindow):
95169516
self.scrollArea_3.setWidgetResizable(True)
95179517
self.scrollAreaWidgetContents_7 = QWidget()
95189518
self.scrollAreaWidgetContents_7.setObjectName(u"scrollAreaWidgetContents_7")
9519-
self.scrollAreaWidgetContents_7.setGeometry(QRect(0, 0, 466, 435))
9519+
self.scrollAreaWidgetContents_7.setGeometry(QRect(0, 0, 442, 219))
95209520
self.gridLayout_19 = QGridLayout(self.scrollAreaWidgetContents_7)
95219521
self.gridLayout_19.setObjectName(u"gridLayout_19")
95229522
self.horizontalSpacer_24 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
@@ -9660,7 +9660,7 @@ def setupUi(self, MainWindow):
96609660
self.scrollArea_4.setWidgetResizable(True)
96619661
self.scrollAreaWidgetContents_8 = QWidget()
96629662
self.scrollAreaWidgetContents_8.setObjectName(u"scrollAreaWidgetContents_8")
9663-
self.scrollAreaWidgetContents_8.setGeometry(QRect(0, 0, 578, 415))
9663+
self.scrollAreaWidgetContents_8.setGeometry(QRect(0, 0, 542, 210))
96649664
self.gridLayout_49 = QGridLayout(self.scrollAreaWidgetContents_8)
96659665
self.gridLayout_49.setObjectName(u"gridLayout_49")
96669666
self.frame_44 = QFrame(self.scrollAreaWidgetContents_8)
@@ -9815,7 +9815,7 @@ def setupUi(self, MainWindow):
98159815
self.scrollArea_5.setWidgetResizable(True)
98169816
self.scrollAreaWidgetContents_9 = QWidget()
98179817
self.scrollAreaWidgetContents_9.setObjectName(u"scrollAreaWidgetContents_9")
9818-
self.scrollAreaWidgetContents_9.setGeometry(QRect(0, 0, 376, 362))
9818+
self.scrollAreaWidgetContents_9.setGeometry(QRect(0, 0, 362, 184))
98199819
self.gridLayout_50 = QGridLayout(self.scrollAreaWidgetContents_9)
98209820
self.gridLayout_50.setObjectName(u"gridLayout_50")
98219821
self.sr_unet_like_heading = QLabel(self.scrollAreaWidgetContents_9)
@@ -9929,7 +9929,7 @@ def setupUi(self, MainWindow):
99299929
self.scrollArea_6.setWidgetResizable(True)
99309930
self.scrollAreaWidgetContents_10 = QWidget()
99319931
self.scrollAreaWidgetContents_10.setObjectName(u"scrollAreaWidgetContents_10")
9932-
self.scrollAreaWidgetContents_10.setGeometry(QRect(0, 0, 430, 340))
9932+
self.scrollAreaWidgetContents_10.setGeometry(QRect(0, 0, 412, 173))
99339933
self.gridLayout_51 = QGridLayout(self.scrollAreaWidgetContents_10)
99349934
self.gridLayout_51.setObjectName(u"gridLayout_51")
99359935
self.label_96 = QLabel(self.scrollAreaWidgetContents_10)
@@ -10058,7 +10058,7 @@ def setupUi(self, MainWindow):
1005810058
self.scrollArea_7.setWidgetResizable(True)
1005910059
self.scrollAreaWidgetContents_11 = QWidget()
1006010060
self.scrollAreaWidgetContents_11.setObjectName(u"scrollAreaWidgetContents_11")
10061-
self.scrollAreaWidgetContents_11.setGeometry(QRect(0, 0, 920, 276))
10061+
self.scrollAreaWidgetContents_11.setGeometry(QRect(0, 0, 920, 326))
1006210062
self.gridLayout_52 = QGridLayout(self.scrollAreaWidgetContents_11)
1006310063
self.gridLayout_52.setObjectName(u"gridLayout_52")
1006410064
self.label_44 = QLabel(self.scrollAreaWidgetContents_11)
@@ -10258,7 +10258,7 @@ def setupUi(self, MainWindow):
1025810258
self.test_scrollArea.setWidgetResizable(True)
1025910259
self.scrollAreaWidgetContents_5 = QWidget()
1026010260
self.scrollAreaWidgetContents_5.setObjectName(u"scrollAreaWidgetContents_5")
10261-
self.scrollAreaWidgetContents_5.setGeometry(QRect(0, 0, 889, 4981))
10261+
self.scrollAreaWidgetContents_5.setGeometry(QRect(0, 0, 910, 2442))
1026210262
self.gridLayout_37 = QGridLayout(self.scrollAreaWidgetContents_5)
1026310263
self.gridLayout_37.setObjectName(u"gridLayout_37")
1026410264
self.test_advanced_options_frame = QFrame(self.scrollAreaWidgetContents_5)
@@ -12030,7 +12030,7 @@ def setupUi(self, MainWindow):
1203012030
self.scrollArea_8.setWidgetResizable(True)
1203112031
self.scrollAreaWidgetContents_12 = QWidget()
1203212032
self.scrollAreaWidgetContents_12.setObjectName(u"scrollAreaWidgetContents_12")
12033-
self.scrollAreaWidgetContents_12.setGeometry(QRect(0, 0, 450, 512))
12033+
self.scrollAreaWidgetContents_12.setGeometry(QRect(0, 0, 428, 257))
1203412034
self.gridLayout_61 = QGridLayout(self.scrollAreaWidgetContents_12)
1203512035
self.gridLayout_61.setObjectName(u"gridLayout_61")
1203612036
self.label_82 = QLabel(self.scrollAreaWidgetContents_12)
@@ -12202,7 +12202,7 @@ def setupUi(self, MainWindow):
1220212202
self.scrollArea_9.setWidgetResizable(True)
1220312203
self.scrollAreaWidgetContents_13 = QWidget()
1220412204
self.scrollAreaWidgetContents_13.setObjectName(u"scrollAreaWidgetContents_13")
12205-
self.scrollAreaWidgetContents_13.setGeometry(QRect(0, 0, 629, 2731))
12205+
self.scrollAreaWidgetContents_13.setGeometry(QRect(0, 0, 585, 1333))
1220612206
self.gridLayout_44 = QGridLayout(self.scrollAreaWidgetContents_13)
1220712207
self.gridLayout_44.setObjectName(u"gridLayout_44")
1220812208
self.label_86 = QLabel(self.scrollAreaWidgetContents_13)
@@ -13120,7 +13120,7 @@ def setupUi(self, MainWindow):
1312013120
self.scrollArea_10.setWidgetResizable(True)
1312113121
self.scrollAreaWidgetContents_14 = QWidget()
1312213122
self.scrollAreaWidgetContents_14.setObjectName(u"scrollAreaWidgetContents_14")
13123-
self.scrollAreaWidgetContents_14.setGeometry(QRect(0, 0, 591, 2184))
13123+
self.scrollAreaWidgetContents_14.setGeometry(QRect(0, 0, 555, 1060))
1312413124
self.gridLayout_47 = QGridLayout(self.scrollAreaWidgetContents_14)
1312513125
self.gridLayout_47.setObjectName(u"gridLayout_47")
1312613126
self.label_100 = QLabel(self.scrollAreaWidgetContents_14)
@@ -13845,7 +13845,7 @@ def setupUi(self, MainWindow):
1384513845
self.scrollArea_11.setWidgetResizable(True)
1384613846
self.scrollAreaWidgetContents_15 = QWidget()
1384713847
self.scrollAreaWidgetContents_15.setObjectName(u"scrollAreaWidgetContents_15")
13848-
self.scrollAreaWidgetContents_15.setGeometry(QRect(0, 0, 369, 93))
13848+
self.scrollAreaWidgetContents_15.setGeometry(QRect(0, 0, 326, 44))
1384913849
self.gridLayout_64 = QGridLayout(self.scrollAreaWidgetContents_15)
1385013850
self.gridLayout_64.setObjectName(u"gridLayout_64")
1385113851
self.verticalSpacer_27 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
@@ -13879,7 +13879,7 @@ def setupUi(self, MainWindow):
1387913879
self.scrollArea_12.setWidgetResizable(True)
1388013880
self.scrollAreaWidgetContents_16 = QWidget()
1388113881
self.scrollAreaWidgetContents_16.setObjectName(u"scrollAreaWidgetContents_16")
13882-
self.scrollAreaWidgetContents_16.setGeometry(QRect(0, 0, 423, 93))
13882+
self.scrollAreaWidgetContents_16.setGeometry(QRect(0, 0, 372, 44))
1388313883
self.gridLayout_65 = QGridLayout(self.scrollAreaWidgetContents_16)
1388413884
self.gridLayout_65.setObjectName(u"gridLayout_65")
1388513885
self.label_102 = QLabel(self.scrollAreaWidgetContents_16)
@@ -13913,7 +13913,7 @@ def setupUi(self, MainWindow):
1391313913
self.scrollArea_13.setWidgetResizable(True)
1391413914
self.scrollAreaWidgetContents_17 = QWidget()
1391513915
self.scrollAreaWidgetContents_17.setObjectName(u"scrollAreaWidgetContents_17")
13916-
self.scrollAreaWidgetContents_17.setGeometry(QRect(0, 0, 483, 93))
13916+
self.scrollAreaWidgetContents_17.setGeometry(QRect(0, 0, 425, 44))
1391713917
self.gridLayout_66 = QGridLayout(self.scrollAreaWidgetContents_17)
1391813918
self.gridLayout_66.setObjectName(u"gridLayout_66")
1391913919
self.label_106 = QLabel(self.scrollAreaWidgetContents_17)
@@ -13947,7 +13947,7 @@ def setupUi(self, MainWindow):
1394713947
self.scrollArea_14.setWidgetResizable(True)
1394813948
self.scrollAreaWidgetContents_18 = QWidget()
1394913949
self.scrollAreaWidgetContents_18.setObjectName(u"scrollAreaWidgetContents_18")
13950-
self.scrollAreaWidgetContents_18.setGeometry(QRect(0, 0, 398, 93))
13950+
self.scrollAreaWidgetContents_18.setGeometry(QRect(0, 0, 346, 44))
1395113951
self.gridLayout_67 = QGridLayout(self.scrollAreaWidgetContents_18)
1395213952
self.gridLayout_67.setObjectName(u"gridLayout_67")
1395313953
self.label_111 = QLabel(self.scrollAreaWidgetContents_18)
@@ -14448,7 +14448,7 @@ def setupUi(self, MainWindow):
1444814448
self.check_yaml_file_errors_frame.setWidgetResizable(True)
1444914449
self.scrollAreaWidgetContents_19 = QWidget()
1445014450
self.scrollAreaWidgetContents_19.setObjectName(u"scrollAreaWidgetContents_19")
14451-
self.scrollAreaWidgetContents_19.setGeometry(QRect(0, 0, 98, 69))
14451+
self.scrollAreaWidgetContents_19.setGeometry(QRect(0, 0, 896, 152))
1445214452
self.verticalLayout_32 = QVBoxLayout(self.scrollAreaWidgetContents_19)
1445314453
self.verticalLayout_32.setObjectName(u"verticalLayout_32")
1445414454
self.verticalLayout_32.setContentsMargins(0, 0, 0, 0)
@@ -14655,7 +14655,7 @@ def retranslateUi(self, MainWindow):
1465514655
#if QT_CONFIG(tooltip)
1465614656
self.goptions_scrollArea.setToolTip("")
1465714657
#endif // QT_CONFIG(tooltip)
14658-
self.MODEL__BMZ__EXPORT__REUSE_BMZ_CONFIG__LABEL.setText(QCoreApplication.translate("MainWindow", u"Reuse BMZ model configuration ", None))
14658+
self.MODEL__BMZ__EXPORT__REUSE_BMZ_CONFIG__LABEL.setText(QCoreApplication.translate("MainWindow", u"Reuse BMZ model configuration ", None))
1465914659
self.MODEL__BMZ__EXPORT__REUSE_BMZ_CONFIG__INPUT.setItemText(0, QCoreApplication.translate("MainWindow", u"No", None))
1466014660
self.MODEL__BMZ__EXPORT__REUSE_BMZ_CONFIG__INPUT.setItemText(1, QCoreApplication.translate("MainWindow", u"Yes", None))
1466114661

@@ -14751,6 +14751,9 @@ def retranslateUi(self, MainWindow):
1475114751
self.LOAD_PRETRAINED_MODEL__LABEL.setText(QCoreApplication.translate("MainWindow", u"Load pretrained model", None))
1475214752
self.checkpoint_file_path_browse_bn.setText(QCoreApplication.translate("MainWindow", u"Browse", None))
1475314753
self.PATHS__CHECKPOINT_FILE__INPUT.setText(QCoreApplication.translate("MainWindow", u"model_weights.pth", None))
14754+
#if QT_CONFIG(tooltip)
14755+
self.LOAD_PRETRAINED_MODEL__INFO.setToolTip(QCoreApplication.translate("MainWindow", u"<html><head/><body><p><span style=\" font-size:12pt;\">This option determines whether to use a pretrained model instead of building one from scratch. If you select &quot;Yes,&quot; additional configuration options will appear, and options related to model selection will be disabled, as a pretrained model will be used.</span></p></body></html>", None))
14756+
#endif // QT_CONFIG(tooltip)
1475414757
self.LOAD_PRETRAINED_MODEL__INFO.setText("")
1475514758
#if QT_CONFIG(tooltip)
1475614759
self.goptions_yaml_name_input.setToolTip("")
@@ -16451,9 +16454,9 @@ def retranslateUi(self, MainWindow):
1645116454
self.TRAIN__PATIENCE__INPUT.setText(QCoreApplication.translate("MainWindow", u"-1", None))
1645216455
self.TRAIN__EPOCHS__INPUT.setText(QCoreApplication.translate("MainWindow", u"100", None))
1645316456
#if QT_CONFIG(tooltip)
16454-
self.label_34.setToolTip("")
16457+
self.MODEL__ARCHITECTURE__LABEL.setToolTip("")
1645516458
#endif // QT_CONFIG(tooltip)
16456-
self.label_34.setText(QCoreApplication.translate("MainWindow", u"Model", None))
16459+
self.MODEL__ARCHITECTURE__LABEL.setText(QCoreApplication.translate("MainWindow", u"Model", None))
1645716460
#if QT_CONFIG(tooltip)
1645816461
self.patience_info.setToolTip(QCoreApplication.translate("MainWindow", u"<html><head/><body><p><span style=\" font-size:12pt;\">How many epochs you want to wait without the model improving its results in the validation set to stop training. </span><span style=\" font-size:12pt; font-weight:600;\">Must be an integer lower than number of epochs</span></p></body></html>", None))
1645916462
#endif // QT_CONFIG(tooltip)

0 commit comments

Comments
 (0)