Example #1
0
 def accept(self) -> None:
     if self.result.color and self.result.name:
         super(NewLabelForm, self).accept()
     else:
         GUIUtilities.show_info_message(
             "The color and name fields are required", "info")
     return
Example #2
0
    def wrapper(*args, **kwargs):
        try:
            # if len(args) == 1:
            #     return func(*args)
            # else:
            return func(*args, **kwargs)

        except Exception as ex:
            exc_type,exc_value,exc_traceback=sys.exc_info()
            GUIUtilities.show_error_message("{}".format(str(traceback.format_exception_only( exc_type, exc_value )[0])))
Example #3
0
 def __init__(self, parent=None):
     super(NewLabelForm, self).__init__(parent)
     self.setupUi(self)
     self.setWindowTitle("Create New Label".title())
     self.setWindowIcon(GUIUtilities.get_icon("polygon.png"))
     self.btn_pick_color.clicked.connect(self.btn_pick_color_click_slot)
     self._result = None
Example #4
0
 def __init__(self, vo: DatasetVO = None, parent=None):
     super(DatasetForm, self).__init__(parent)
     self.setupUi(self)
     self.setWindowTitle("Create new dataset".title())
     self.setWindowIcon(GUIUtilities.get_icon("polygon.png"))
     self._value = vo
     self.initialize_form()
Example #5
0
 def accept(self) -> None:
     if not self.nameLineEdit.text():
         GUIUtilities.show_info_message("The name field is required",
                                        "info")
         return
     if self._value is None:
         usr_folder = FileUtilities.get_usr_folder()
         new_folder = FileUtilities.create_new_folder(usr_folder)
         vo = DatasetVO()
         ds_folder = os.path.basename(new_folder)
         vo.folder = ds_folder
         self._value = vo
     else:
         vo = self._value
     vo.name = self.nameLineEdit.text()
     vo.description = self.descriptionEditText.toPlainText()
     # dataset_vo.data_type=self.typeComboBox.currentText()
     return QDialog.accept(self)
Example #6
0
 def __init__(self, parent=None):
     super(ModelsTreeview, self).__init__(parent)
     self.setIconSize(QSize(18, 18))
     self.setDragDropMode(QAbstractItemView.InternalMove)
     self.setDragEnabled(True)
     self.setAcceptDrops(True)
     self.setCursor(QtCore.Qt.PointingHandCursor)
     self.setDropIndicatorShown(True)
     self._thread_pool = QThreadPool()
     self._loading_dialog = QLoadingDialog()
     model: CustomModel = CustomModel(["Name", "Uri"])
     self._root_node = CustomNode(["Models", ""], level=1, status=1, success_icon=gui.get_icon("database.png"))
     model.addChild(self._root_node)
     self.setModel(model)
Example #7
0
 def __init__(self, parent=None):
     super(ImageViewerToolBox, self).__init__(parent)
     self._icon_size = QSize(28, 28)
     self._toolbox = [
         SwitchButton(icon=GUIUtilities.get_icon("polygon.png"), tag="polygon", tooltip="polygon tool"),
         SwitchButton(icon=GUIUtilities.get_icon("square.png"), tag="box", tooltip="box tool"),
         SwitchButton(icon=GUIUtilities.get_icon("circle.png"), tag="ellipse", tooltip="ellipse tool"),
         SwitchButton(icon=GUIUtilities.get_icon("highlighter.png"), tag="free", tooltip="free draw tool"),
         SwitchButton(icon=GUIUtilities.get_icon("robotic-hand.png"), tag="points", tooltip="extreme points tool"),
         SwitchButton(icon=GUIUtilities.get_icon("cursor.png"), tag="pointer", tooltip="pointer tool"),
         ImageButton(icon=GUIUtilities.get_icon("save-icon.png"), size=self._icon_size, tag="save", tooltip="save annotations"),
         ImageButton(icon=GUIUtilities.get_icon("clean.png"), size=self._icon_size, tag="clean", tooltip="clean annotations")]
     self._layout = QVBoxLayout(self)
     for button in self._toolbox:
         self._layout.addWidget(button)
         self._layout.addWidget(SeparatorWidget())
         button.clicked.connect(self._action_toolbox_clicked_slot)