Ejemplo n.º 1
0
 def initAppletDrawerUi(self):
     training_controls = EdgeTrainingGui.createDrawerControls(self)
     training_controls.layout().setContentsMargins(5,0,5,0)
     training_layout = QVBoxLayout()
     training_layout.addWidget( training_controls )
     training_layout.setContentsMargins(0,15,0,0)
     training_box = QGroupBox( "Training", parent=self )
     training_box.setLayout(training_layout)
     training_box.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
     
     multicut_controls = MulticutGuiMixin.createDrawerControls(self)
     multicut_controls.layout().setContentsMargins(5,0,5,0)
     multicut_layout = QVBoxLayout()
     multicut_layout.addWidget( multicut_controls )
     multicut_layout.setContentsMargins(0,15,0,0)
     multicut_box = QGroupBox( "Multicut", parent=self )
     multicut_box.setLayout(multicut_layout)
     multicut_box.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
     
     drawer_layout = QVBoxLayout()
     drawer_layout.addWidget(training_box)
     drawer_layout.addWidget(multicut_box)
     drawer_layout.setSpacing(2)
     drawer_layout.setContentsMargins(5,5,5,5)
     drawer_layout.addSpacerItem( QSpacerItem(0, 10, QSizePolicy.Minimum, QSizePolicy.Expanding) )
     
     self._drawer = QWidget(parent=self)
     self._drawer.setLayout(drawer_layout)        
Ejemplo n.º 2
0
    def initAppletDrawerUi(self):
        training_controls = EdgeTrainingGui.createDrawerControls(self)
        training_controls.layout().setContentsMargins(5, 0, 5, 0)
        training_layout = QVBoxLayout()
        training_layout.addWidget(training_controls)
        training_layout.setContentsMargins(0, 15, 0, 0)
        training_box = QGroupBox("Training", parent=self)
        training_box.setLayout(training_layout)
        training_box.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)

        multicut_controls = MulticutGuiMixin.createDrawerControls(self)
        multicut_controls.layout().setContentsMargins(5, 0, 5, 0)
        multicut_layout = QVBoxLayout()
        multicut_layout.addWidget(multicut_controls)
        multicut_layout.setContentsMargins(0, 15, 0, 0)
        multicut_box = QGroupBox("Multicut", parent=self)
        multicut_box.setLayout(multicut_layout)
        multicut_box.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        multicut_box.setEnabled(False)

        op = self.topLevelOperatorView
        multicut_required_slots = (op.Superpixels, op.Rag, op.EdgeProbabilities, op.EdgeProbabilitiesDict)
        self.__cleanup_fns.append(guiutil.enable_when_ready(multicut_box, multicut_required_slots))

        drawer_layout = QVBoxLayout()
        drawer_layout.addWidget(training_box)
        drawer_layout.addWidget(multicut_box)
        drawer_layout.setSpacing(2)
        drawer_layout.setContentsMargins(5, 5, 5, 5)
        drawer_layout.addSpacerItem(QSpacerItem(0, 10, QSizePolicy.Minimum, QSizePolicy.Expanding))

        self._drawer = QWidget(parent=self)
        self._drawer.setLayout(drawer_layout)
 def initAppletDrawerUi(self):
     training_controls = EdgeTrainingGui.createDrawerControls(self)
     training_controls.layout().setContentsMargins(5,0,5,0)
     training_layout = QVBoxLayout()
     training_layout.addWidget( training_controls )
     training_layout.setContentsMargins(0,0,0,0)
     training_box = QGroupBox( "Training", parent=self )
     training_box.setLayout(training_layout)
     training_box.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
     
     multicut_controls = MulticutGuiMixin.createDrawerControls(self)
     multicut_controls.layout().setContentsMargins(5,0,5,0)
     multicut_layout = QVBoxLayout()
     multicut_layout.addWidget( multicut_controls )
     multicut_layout.setContentsMargins(0,0,0,0)
     multicut_box = QGroupBox( "Multicut", parent=self )
     multicut_box.setLayout(multicut_layout)
     multicut_box.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
     
     drawer_layout = QVBoxLayout()
     drawer_layout.addWidget(training_box)
     drawer_layout.addWidget(multicut_box)
     drawer_layout.setSpacing(2)
     drawer_layout.setContentsMargins(5,5,5,5)
     drawer_layout.addSpacerItem( QSpacerItem(0, 10, QSizePolicy.Minimum, QSizePolicy.Expanding) )
     
     self._drawer = QWidget(parent=self)
     self._drawer.setLayout(drawer_layout)        
Ejemplo n.º 4
0
    def initAppletDrawerUi(self):

        self.train_edge_clf_box = QCheckBox(
            text="Train edge classifier",
            toolTip=
            "Manually select features and train a random forest classifier on them, to predict boundary probabilities. If left unchecked, training will be skiped, and probabilities will be calculated based on the mean probability along edges. This produces good results for clear boundaries.",
            checked=False,
        )

        training_controls = EdgeTrainingMixin.createDrawerControls(self)
        training_controls.layout().setContentsMargins(5, 0, 5, 0)
        training_layout = QVBoxLayout()
        training_layout.addWidget(training_controls)
        training_layout.setContentsMargins(0, 15, 0, 0)
        training_box = QGroupBox("Training", parent=self)
        training_box.setLayout(training_layout)
        training_box.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        training_box.setEnabled(self.train_edge_clf_box.isChecked())

        multicut_controls = MulticutGuiMixin.createDrawerControls(self)
        multicut_controls.layout().setContentsMargins(5, 0, 5, 0)
        multicut_layout = QVBoxLayout()
        multicut_layout.addWidget(multicut_controls)
        multicut_layout.setContentsMargins(0, 15, 0, 0)
        multicut_box = QGroupBox("Multicut", parent=self)
        multicut_box.setLayout(multicut_layout)
        multicut_box.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        multicut_box.setEnabled(True)

        op = self.topLevelOperatorView
        multicut_required_slots = (op.Superpixels, op.Rag,
                                   op.EdgeProbabilities,
                                   op.EdgeProbabilitiesDict)
        self.__cleanup_fns.append(
            guiutil.enable_when_ready(multicut_box, multicut_required_slots))

        def _handle_train_edge_clf_box_clicked():
            training_box.setEnabled(self.train_edge_clf_box.isChecked())
            op.TrainRandomForest.setValue(self.train_edge_clf_box.isChecked())

        self.train_edge_clf_box.toggled.connect(
            _handle_train_edge_clf_box_clicked)

        drawer_layout = QVBoxLayout()
        drawer_layout.addWidget(self.train_edge_clf_box)
        drawer_layout.addWidget(training_box)
        drawer_layout.addWidget(multicut_box)
        drawer_layout.setSpacing(2)
        drawer_layout.setContentsMargins(5, 5, 5, 5)
        drawer_layout.addSpacerItem(
            QSpacerItem(0, 10, QSizePolicy.Minimum, QSizePolicy.Expanding))

        self._drawer = QWidget(parent=self)
        self._drawer.setLayout(drawer_layout)
Ejemplo n.º 5
0
    def initAppletDrawerUi(self):
        training_controls = EdgeTrainingGui.createDrawerControls(self)
        training_controls.layout().setContentsMargins(5,0,5,0)
        training_layout = QVBoxLayout()
        training_layout.addWidget( training_controls )
        training_layout.setContentsMargins(0,15,0,0)
        training_box = QGroupBox( "Training", parent=self )
        training_box.setLayout(training_layout)
        training_box.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        
        multicut_controls = MulticutGuiMixin.createDrawerControls(self)
        multicut_controls.layout().setContentsMargins(5,0,5,0)
        multicut_layout = QVBoxLayout()
        multicut_layout.addWidget( multicut_controls )
        multicut_layout.setContentsMargins(0,15,0,0)
        multicut_box = QGroupBox( "Multicut", parent=self )
        multicut_box.setLayout(multicut_layout)
        multicut_box.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        multicut_box.setEnabled(False)

        op = self.topLevelOperatorView
        multicut_required_slots = (
            op.Superpixels,
            op.Rag,
            op.EdgeProbabilities,
            op.EdgeProbabilitiesDict,
        )
        self.__cleanup_fns.append(guiutil.enable_when_ready(multicut_box, multicut_required_slots))

        drawer_layout = QVBoxLayout()
        drawer_layout.addWidget(training_box)
        drawer_layout.addWidget(multicut_box)
        drawer_layout.setSpacing(2)
        drawer_layout.setContentsMargins(5,5,5,5)
        drawer_layout.addSpacerItem( QSpacerItem(0, 10, QSizePolicy.Minimum, QSizePolicy.Expanding) )
        
        self._drawer = QWidget(parent=self)
        self._drawer.setLayout(drawer_layout)