update
This commit is contained in:
		
							parent
							
								
									977f889b01
								
							
						
					
					
						commit
						709b19e1d8
					
				@ -19,7 +19,7 @@ class FROMCOCO(QThread):
 | 
				
			|||||||
        self.to_root:str = None
 | 
					        self.to_root:str = None
 | 
				
			||||||
        self.keep_crowd = False
 | 
					        self.keep_crowd = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.cache = False
 | 
					        self.cancel = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def run(self):
 | 
					    def run(self):
 | 
				
			||||||
        assert self.coco_json_path.endswith('.json')
 | 
					        assert self.coco_json_path.endswith('.json')
 | 
				
			||||||
@ -45,7 +45,7 @@ class FROMCOCO(QThread):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                self.message.emit(None, None, 'Loading annotations...')
 | 
					                self.message.emit(None, None, 'Loading annotations...')
 | 
				
			||||||
                for index, annotation in enumerate(annotations):
 | 
					                for index, annotation in enumerate(annotations):
 | 
				
			||||||
                    if self.cache:
 | 
					                    if self.cancel:
 | 
				
			||||||
                        return
 | 
					                        return
 | 
				
			||||||
                    self.message.emit(index+1, len(annotations), None)
 | 
					                    self.message.emit(index+1, len(annotations), None)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -129,7 +129,7 @@ class FROMCOCO(QThread):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                self.message.emit(None, None, 'Start convert to ISAT json...')
 | 
					                self.message.emit(None, None, 'Start convert to ISAT json...')
 | 
				
			||||||
                for index, (image_id, values) in enumerate(annos.items()):
 | 
					                for index, (image_id, values) in enumerate(annos.items()):
 | 
				
			||||||
                    if self.cache:
 | 
					                    if self.cancel:
 | 
				
			||||||
                        return
 | 
					                        return
 | 
				
			||||||
                    image_path = images[image_id].get('file_name')
 | 
					                    image_path = images[image_id].get('file_name')
 | 
				
			||||||
                    folder, name = os.path.split(image_path)
 | 
					                    folder, name = os.path.split(image_path)
 | 
				
			||||||
 | 
				
			|||||||
@ -14,7 +14,7 @@ class TOCOCO(QThread):
 | 
				
			|||||||
        super(TOCOCO, self).__init__()
 | 
					        super(TOCOCO, self).__init__()
 | 
				
			||||||
        self.isat_json_root:str = None
 | 
					        self.isat_json_root:str = None
 | 
				
			||||||
        self.to_path:str = None
 | 
					        self.to_path:str = None
 | 
				
			||||||
        self.cache = False
 | 
					        self.cancel = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def run(self):
 | 
					    def run(self):
 | 
				
			||||||
        coco_anno = {}
 | 
					        coco_anno = {}
 | 
				
			||||||
@ -45,7 +45,7 @@ class TOCOCO(QThread):
 | 
				
			|||||||
        num_jsons = len(jsons)
 | 
					        num_jsons = len(jsons)
 | 
				
			||||||
        self.message.emit(None, None, 'Loading ISAT jsons...')
 | 
					        self.message.emit(None, None, 'Loading ISAT jsons...')
 | 
				
			||||||
        for file_index, json in enumerate(jsons):
 | 
					        for file_index, json in enumerate(jsons):
 | 
				
			||||||
            if self.cache:
 | 
					            if self.cancel:
 | 
				
			||||||
                return
 | 
					                return
 | 
				
			||||||
            self.message.emit(file_index+1, num_jsons, '{:>8d}/{:<8d} | Loading ISAT json: {}'.format(file_index+1, num_jsons, json))
 | 
					            self.message.emit(file_index+1, num_jsons, '{:>8d}/{:<8d} | Loading ISAT json: {}'.format(file_index+1, num_jsons, json))
 | 
				
			||||||
            try:
 | 
					            try:
 | 
				
			||||||
 | 
				
			|||||||
@ -20,7 +20,7 @@ class TOVOC(QThread):
 | 
				
			|||||||
        self.to_root = None
 | 
					        self.to_root = None
 | 
				
			||||||
        self.is_instance = False
 | 
					        self.is_instance = False
 | 
				
			||||||
        self.keep_crowd = False
 | 
					        self.keep_crowd = False
 | 
				
			||||||
        self.cache = False
 | 
					        self.cancel = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def run(self):
 | 
					    def run(self):
 | 
				
			||||||
        labels = self.cfg.get('label', [])
 | 
					        labels = self.cfg.get('label', [])
 | 
				
			||||||
@ -48,7 +48,7 @@ class TOVOC(QThread):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        for index, json in enumerate(jsons):
 | 
					        for index, json in enumerate(jsons):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if self.cache:
 | 
					            if self.cancel:
 | 
				
			||||||
                return
 | 
					                return
 | 
				
			||||||
            from_path = os.path.join(self.from_root, json)
 | 
					            from_path = os.path.join(self.from_root, json)
 | 
				
			||||||
            self.message.emit(index+1, num_jsons, '{:>8d}/{:<8d} | Loading json:{}'.format(index+1, num_jsons, json))
 | 
					            self.message.emit(index+1, num_jsons, '{:>8d}/{:<8d} | Loading json:{}'.format(index+1, num_jsons, json))
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
# -*- coding: utf-8 -*-
 | 
					# -*- coding: utf-8 -*-
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Form implementation generated from reading ui file '/home/super/PycharmProjects/ISAT_with_segment_anything/ui/COCO_to_ISAT_dialog.ui'
 | 
					# Form implementation generated from reading ui file 'COCO_to_ISAT_dialog.ui'
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Created by: PyQt5 UI code generator 5.15.7
 | 
					# Created by: PyQt5 UI code generator 5.15.7
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@ -85,12 +85,12 @@ class Ui_Dialog(object):
 | 
				
			|||||||
        self.horizontalLayout.addWidget(self.label)
 | 
					        self.horizontalLayout.addWidget(self.label)
 | 
				
			||||||
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
 | 
					        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
 | 
				
			||||||
        self.horizontalLayout.addItem(spacerItem1)
 | 
					        self.horizontalLayout.addItem(spacerItem1)
 | 
				
			||||||
        self.pushButton_cache = QtWidgets.QPushButton(self.widget_2)
 | 
					        self.pushButton_cancel = QtWidgets.QPushButton(self.widget_2)
 | 
				
			||||||
        icon = QtGui.QIcon()
 | 
					        icon = QtGui.QIcon()
 | 
				
			||||||
        icon.addPixmap(QtGui.QPixmap(":/icons/icons/关闭_close-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
					        icon.addPixmap(QtGui.QPixmap(":/icons/icons/关闭_close-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
				
			||||||
        self.pushButton_cache.setIcon(icon)
 | 
					        self.pushButton_cancel.setIcon(icon)
 | 
				
			||||||
        self.pushButton_cache.setObjectName("pushButton_cache")
 | 
					        self.pushButton_cancel.setObjectName("pushButton_cancel")
 | 
				
			||||||
        self.horizontalLayout.addWidget(self.pushButton_cache)
 | 
					        self.horizontalLayout.addWidget(self.pushButton_cancel)
 | 
				
			||||||
        self.pushButton_apply = QtWidgets.QPushButton(self.widget_2)
 | 
					        self.pushButton_apply = QtWidgets.QPushButton(self.widget_2)
 | 
				
			||||||
        icon1 = QtGui.QIcon()
 | 
					        icon1 = QtGui.QIcon()
 | 
				
			||||||
        icon1.addPixmap(QtGui.QPixmap(":/icons/icons/校验_check-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
					        icon1.addPixmap(QtGui.QPixmap(":/icons/icons/校验_check-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
				
			||||||
@ -111,6 +111,6 @@ class Ui_Dialog(object):
 | 
				
			|||||||
        self.lineEdit_label_path.setPlaceholderText(_translate("Dialog", "COCO json path"))
 | 
					        self.lineEdit_label_path.setPlaceholderText(_translate("Dialog", "COCO json path"))
 | 
				
			||||||
        self.checkBox_keepcrowd.setText(_translate("Dialog", "Keep crowd"))
 | 
					        self.checkBox_keepcrowd.setText(_translate("Dialog", "Keep crowd"))
 | 
				
			||||||
        self.label.setText(_translate("Dialog", "Convert COCO json to ISAT jsons.All layer attr is 1."))
 | 
					        self.label.setText(_translate("Dialog", "Convert COCO json to ISAT jsons.All layer attr is 1."))
 | 
				
			||||||
        self.pushButton_cache.setText(_translate("Dialog", "cache"))
 | 
					        self.pushButton_cancel.setText(_translate("Dialog", "cancel"))
 | 
				
			||||||
        self.pushButton_apply.setText(_translate("Dialog", "convert"))
 | 
					        self.pushButton_apply.setText(_translate("Dialog", "convert"))
 | 
				
			||||||
import icons_rc
 | 
					import icons_rc
 | 
				
			||||||
 | 
				
			|||||||
@ -201,9 +201,9 @@
 | 
				
			|||||||
       </spacer>
 | 
					       </spacer>
 | 
				
			||||||
      </item>
 | 
					      </item>
 | 
				
			||||||
      <item>
 | 
					      <item>
 | 
				
			||||||
       <widget class="QPushButton" name="pushButton_cache">
 | 
					       <widget class="QPushButton" name="pushButton_cancel">
 | 
				
			||||||
        <property name="text">
 | 
					        <property name="text">
 | 
				
			||||||
         <string>cache</string>
 | 
					         <string>cancel</string>
 | 
				
			||||||
        </property>
 | 
					        </property>
 | 
				
			||||||
        <property name="icon">
 | 
					        <property name="icon">
 | 
				
			||||||
         <iconset>
 | 
					         <iconset>
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
# -*- coding: utf-8 -*-
 | 
					# -*- coding: utf-8 -*-
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Form implementation generated from reading ui file '/home/super/PycharmProjects/ISAT_with_segment_anything/ui/ISAT_to_COCO_dialog.ui'
 | 
					# Form implementation generated from reading ui file 'ISAT_to_COCO_dialog.ui'
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Created by: PyQt5 UI code generator 5.15.7
 | 
					# Created by: PyQt5 UI code generator 5.15.7
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@ -15,7 +15,7 @@ class Ui_Dialog(object):
 | 
				
			|||||||
    def setupUi(self, Dialog):
 | 
					    def setupUi(self, Dialog):
 | 
				
			||||||
        Dialog.setObjectName("Dialog")
 | 
					        Dialog.setObjectName("Dialog")
 | 
				
			||||||
        Dialog.setWindowModality(QtCore.Qt.NonModal)
 | 
					        Dialog.setWindowModality(QtCore.Qt.NonModal)
 | 
				
			||||||
        Dialog.resize(600, 226)
 | 
					        Dialog.resize(600, 227)
 | 
				
			||||||
        font = QtGui.QFont()
 | 
					        font = QtGui.QFont()
 | 
				
			||||||
        font.setFamily("Times New Roman")
 | 
					        font.setFamily("Times New Roman")
 | 
				
			||||||
        font.setPointSize(12)
 | 
					        font.setPointSize(12)
 | 
				
			||||||
@ -74,12 +74,12 @@ class Ui_Dialog(object):
 | 
				
			|||||||
        self.horizontalLayout.addWidget(self.label)
 | 
					        self.horizontalLayout.addWidget(self.label)
 | 
				
			||||||
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
 | 
					        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
 | 
				
			||||||
        self.horizontalLayout.addItem(spacerItem)
 | 
					        self.horizontalLayout.addItem(spacerItem)
 | 
				
			||||||
        self.pushButton_cache = QtWidgets.QPushButton(self.widget_2)
 | 
					        self.pushButton_cancel = QtWidgets.QPushButton(self.widget_2)
 | 
				
			||||||
        icon = QtGui.QIcon()
 | 
					        icon = QtGui.QIcon()
 | 
				
			||||||
        icon.addPixmap(QtGui.QPixmap(":/icons/icons/关闭_close-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
					        icon.addPixmap(QtGui.QPixmap(":/icons/icons/关闭_close-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
				
			||||||
        self.pushButton_cache.setIcon(icon)
 | 
					        self.pushButton_cancel.setIcon(icon)
 | 
				
			||||||
        self.pushButton_cache.setObjectName("pushButton_cache")
 | 
					        self.pushButton_cancel.setObjectName("pushButton_cancel")
 | 
				
			||||||
        self.horizontalLayout.addWidget(self.pushButton_cache)
 | 
					        self.horizontalLayout.addWidget(self.pushButton_cancel)
 | 
				
			||||||
        self.pushButton_apply = QtWidgets.QPushButton(self.widget_2)
 | 
					        self.pushButton_apply = QtWidgets.QPushButton(self.widget_2)
 | 
				
			||||||
        icon1 = QtGui.QIcon()
 | 
					        icon1 = QtGui.QIcon()
 | 
				
			||||||
        icon1.addPixmap(QtGui.QPixmap(":/icons/icons/校验_check-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
					        icon1.addPixmap(QtGui.QPixmap(":/icons/icons/校验_check-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
				
			||||||
@ -104,6 +104,6 @@ class Ui_Dialog(object):
 | 
				
			|||||||
"</style></head><body style=\" font-family:\'宋体\'; font-size:12pt; font-weight:400; font-style:normal;\">\n"
 | 
					"</style></head><body style=\" font-family:\'宋体\'; font-size:12pt; font-weight:400; font-style:normal;\">\n"
 | 
				
			||||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'Times New Roman\';\"><br /></p></body></html>"))
 | 
					"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'Times New Roman\';\"><br /></p></body></html>"))
 | 
				
			||||||
        self.label.setText(_translate("Dialog", "Convert ISAT jsons to COCO json.The layer attr will be lost."))
 | 
					        self.label.setText(_translate("Dialog", "Convert ISAT jsons to COCO json.The layer attr will be lost."))
 | 
				
			||||||
        self.pushButton_cache.setText(_translate("Dialog", "cache"))
 | 
					        self.pushButton_cancel.setText(_translate("Dialog", "cancel"))
 | 
				
			||||||
        self.pushButton_apply.setText(_translate("Dialog", "convert"))
 | 
					        self.pushButton_apply.setText(_translate("Dialog", "convert"))
 | 
				
			||||||
import icons_rc
 | 
					import icons_rc
 | 
				
			||||||
 | 
				
			|||||||
@ -10,7 +10,7 @@
 | 
				
			|||||||
    <x>0</x>
 | 
					    <x>0</x>
 | 
				
			||||||
    <y>0</y>
 | 
					    <y>0</y>
 | 
				
			||||||
    <width>600</width>
 | 
					    <width>600</width>
 | 
				
			||||||
    <height>226</height>
 | 
					    <height>227</height>
 | 
				
			||||||
   </rect>
 | 
					   </rect>
 | 
				
			||||||
  </property>
 | 
					  </property>
 | 
				
			||||||
  <property name="font">
 | 
					  <property name="font">
 | 
				
			||||||
@ -170,9 +170,9 @@ p, li { white-space: pre-wrap; }
 | 
				
			|||||||
       </spacer>
 | 
					       </spacer>
 | 
				
			||||||
      </item>
 | 
					      </item>
 | 
				
			||||||
      <item>
 | 
					      <item>
 | 
				
			||||||
       <widget class="QPushButton" name="pushButton_cache">
 | 
					       <widget class="QPushButton" name="pushButton_cancel">
 | 
				
			||||||
        <property name="text">
 | 
					        <property name="text">
 | 
				
			||||||
         <string>cache</string>
 | 
					         <string>cancel</string>
 | 
				
			||||||
        </property>
 | 
					        </property>
 | 
				
			||||||
        <property name="icon">
 | 
					        <property name="icon">
 | 
				
			||||||
         <iconset>
 | 
					         <iconset>
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
# -*- coding: utf-8 -*-
 | 
					# -*- coding: utf-8 -*-
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Form implementation generated from reading ui file '/home/super/PycharmProjects/ISAT_with_segment_anything/ui/ISAT_to_VOC_dialog.ui'
 | 
					# Form implementation generated from reading ui file 'ISAT_to_VOC_dialog.ui'
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Created by: PyQt5 UI code generator 5.15.7
 | 
					# Created by: PyQt5 UI code generator 5.15.7
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@ -86,12 +86,12 @@ class Ui_Dialog(object):
 | 
				
			|||||||
        self.horizontalLayout.addWidget(self.label)
 | 
					        self.horizontalLayout.addWidget(self.label)
 | 
				
			||||||
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
 | 
					        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
 | 
				
			||||||
        self.horizontalLayout.addItem(spacerItem1)
 | 
					        self.horizontalLayout.addItem(spacerItem1)
 | 
				
			||||||
        self.pushButton_cache = QtWidgets.QPushButton(self.widget_2)
 | 
					        self.pushButton_cancel = QtWidgets.QPushButton(self.widget_2)
 | 
				
			||||||
        icon = QtGui.QIcon()
 | 
					        icon = QtGui.QIcon()
 | 
				
			||||||
        icon.addPixmap(QtGui.QPixmap(":/icons/icons/关闭_close-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
					        icon.addPixmap(QtGui.QPixmap(":/icons/icons/关闭_close-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
				
			||||||
        self.pushButton_cache.setIcon(icon)
 | 
					        self.pushButton_cancel.setIcon(icon)
 | 
				
			||||||
        self.pushButton_cache.setObjectName("pushButton_cache")
 | 
					        self.pushButton_cancel.setObjectName("pushButton_cancel")
 | 
				
			||||||
        self.horizontalLayout.addWidget(self.pushButton_cache)
 | 
					        self.horizontalLayout.addWidget(self.pushButton_cancel)
 | 
				
			||||||
        self.pushButton_apply = QtWidgets.QPushButton(self.widget_2)
 | 
					        self.pushButton_apply = QtWidgets.QPushButton(self.widget_2)
 | 
				
			||||||
        icon1 = QtGui.QIcon()
 | 
					        icon1 = QtGui.QIcon()
 | 
				
			||||||
        icon1.addPixmap(QtGui.QPixmap(":/icons/icons/校验_check-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
					        icon1.addPixmap(QtGui.QPixmap(":/icons/icons/校验_check-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
				
			||||||
@ -118,6 +118,6 @@ class Ui_Dialog(object):
 | 
				
			|||||||
"</style></head><body style=\" font-family:\'宋体\'; font-size:12pt; font-weight:400; font-style:normal;\">\n"
 | 
					"</style></head><body style=\" font-family:\'宋体\'; font-size:12pt; font-weight:400; font-style:normal;\">\n"
 | 
				
			||||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>"))
 | 
					"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>"))
 | 
				
			||||||
        self.label.setText(_translate("Dialog", "Convert ISAT annotations to VOC png."))
 | 
					        self.label.setText(_translate("Dialog", "Convert ISAT annotations to VOC png."))
 | 
				
			||||||
        self.pushButton_cache.setText(_translate("Dialog", "cache"))
 | 
					        self.pushButton_cancel.setText(_translate("Dialog", "cancel"))
 | 
				
			||||||
        self.pushButton_apply.setText(_translate("Dialog", "convert"))
 | 
					        self.pushButton_apply.setText(_translate("Dialog", "convert"))
 | 
				
			||||||
import icons_rc
 | 
					import icons_rc
 | 
				
			||||||
 | 
				
			|||||||
@ -207,9 +207,9 @@ p, li { white-space: pre-wrap; }
 | 
				
			|||||||
       </spacer>
 | 
					       </spacer>
 | 
				
			||||||
      </item>
 | 
					      </item>
 | 
				
			||||||
      <item>
 | 
					      <item>
 | 
				
			||||||
       <widget class="QPushButton" name="pushButton_cache">
 | 
					       <widget class="QPushButton" name="pushButton_cancel">
 | 
				
			||||||
        <property name="text">
 | 
					        <property name="text">
 | 
				
			||||||
         <string>cache</string>
 | 
					         <string>cancel</string>
 | 
				
			||||||
        </property>
 | 
					        </property>
 | 
				
			||||||
        <property name="icon">
 | 
					        <property name="icon">
 | 
				
			||||||
         <iconset>
 | 
					         <iconset>
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
# -*- coding: utf-8 -*-
 | 
					# -*- coding: utf-8 -*-
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Form implementation generated from reading ui file '/home/super/PycharmProjects/ISAT_with_segment_anything/ui/category_choice.ui'
 | 
					# Form implementation generated from reading ui file 'category_choice.ui'
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Created by: PyQt5 UI code generator 5.15.7
 | 
					# Created by: PyQt5 UI code generator 5.15.7
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@ -14,7 +14,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets
 | 
				
			|||||||
class Ui_Dialog(object):
 | 
					class Ui_Dialog(object):
 | 
				
			||||||
    def setupUi(self, Dialog):
 | 
					    def setupUi(self, Dialog):
 | 
				
			||||||
        Dialog.setObjectName("Dialog")
 | 
					        Dialog.setObjectName("Dialog")
 | 
				
			||||||
        Dialog.resize(350, 400)
 | 
					        Dialog.resize(350, 399)
 | 
				
			||||||
        font = QtGui.QFont()
 | 
					        font = QtGui.QFont()
 | 
				
			||||||
        font.setFamily("Times New Roman")
 | 
					        font.setFamily("Times New Roman")
 | 
				
			||||||
        font.setPointSize(12)
 | 
					        font.setPointSize(12)
 | 
				
			||||||
@ -97,12 +97,12 @@ class Ui_Dialog(object):
 | 
				
			|||||||
        self.horizontalLayout_2.addWidget(self.checkBox_iscrowded)
 | 
					        self.horizontalLayout_2.addWidget(self.checkBox_iscrowded)
 | 
				
			||||||
        spacerItem = QtWidgets.QSpacerItem(97, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
 | 
					        spacerItem = QtWidgets.QSpacerItem(97, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
 | 
				
			||||||
        self.horizontalLayout_2.addItem(spacerItem)
 | 
					        self.horizontalLayout_2.addItem(spacerItem)
 | 
				
			||||||
        self.pushButton_cache = QtWidgets.QPushButton(self.widget_2)
 | 
					        self.pushButton_cancel = QtWidgets.QPushButton(self.widget_2)
 | 
				
			||||||
        icon = QtGui.QIcon()
 | 
					        icon = QtGui.QIcon()
 | 
				
			||||||
        icon.addPixmap(QtGui.QPixmap(":/icons/icons/关闭_close-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
					        icon.addPixmap(QtGui.QPixmap(":/icons/icons/关闭_close-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
				
			||||||
        self.pushButton_cache.setIcon(icon)
 | 
					        self.pushButton_cancel.setIcon(icon)
 | 
				
			||||||
        self.pushButton_cache.setObjectName("pushButton_cache")
 | 
					        self.pushButton_cancel.setObjectName("pushButton_cancel")
 | 
				
			||||||
        self.horizontalLayout_2.addWidget(self.pushButton_cache)
 | 
					        self.horizontalLayout_2.addWidget(self.pushButton_cancel)
 | 
				
			||||||
        self.pushButton_apply = QtWidgets.QPushButton(self.widget_2)
 | 
					        self.pushButton_apply = QtWidgets.QPushButton(self.widget_2)
 | 
				
			||||||
        icon1 = QtGui.QIcon()
 | 
					        icon1 = QtGui.QIcon()
 | 
				
			||||||
        icon1.addPixmap(QtGui.QPixmap(":/icons/icons/校验_check-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
					        icon1.addPixmap(QtGui.QPixmap(":/icons/icons/校验_check-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
				
			||||||
@ -123,6 +123,6 @@ class Ui_Dialog(object):
 | 
				
			|||||||
        self.lineEdit_note.setPlaceholderText(_translate("Dialog", "add extra note here"))
 | 
					        self.lineEdit_note.setPlaceholderText(_translate("Dialog", "add extra note here"))
 | 
				
			||||||
        self.label_4.setText(_translate("Dialog", "layer:"))
 | 
					        self.label_4.setText(_translate("Dialog", "layer:"))
 | 
				
			||||||
        self.checkBox_iscrowded.setText(_translate("Dialog", "is crowded"))
 | 
					        self.checkBox_iscrowded.setText(_translate("Dialog", "is crowded"))
 | 
				
			||||||
        self.pushButton_cache.setText(_translate("Dialog", "cache"))
 | 
					        self.pushButton_cancel.setText(_translate("Dialog", "cancel"))
 | 
				
			||||||
        self.pushButton_apply.setText(_translate("Dialog", "apply"))
 | 
					        self.pushButton_apply.setText(_translate("Dialog", "apply"))
 | 
				
			||||||
import icons_rc
 | 
					import icons_rc
 | 
				
			||||||
 | 
				
			|||||||
@ -7,7 +7,7 @@
 | 
				
			|||||||
    <x>0</x>
 | 
					    <x>0</x>
 | 
				
			||||||
    <y>0</y>
 | 
					    <y>0</y>
 | 
				
			||||||
    <width>350</width>
 | 
					    <width>350</width>
 | 
				
			||||||
    <height>400</height>
 | 
					    <height>399</height>
 | 
				
			||||||
   </rect>
 | 
					   </rect>
 | 
				
			||||||
  </property>
 | 
					  </property>
 | 
				
			||||||
  <property name="font">
 | 
					  <property name="font">
 | 
				
			||||||
@ -259,12 +259,12 @@
 | 
				
			|||||||
       </spacer>
 | 
					       </spacer>
 | 
				
			||||||
      </item>
 | 
					      </item>
 | 
				
			||||||
      <item>
 | 
					      <item>
 | 
				
			||||||
       <widget class="QPushButton" name="pushButton_cache">
 | 
					       <widget class="QPushButton" name="pushButton_cancel">
 | 
				
			||||||
        <property name="text">
 | 
					        <property name="text">
 | 
				
			||||||
         <string>cache</string>
 | 
					         <string>cancel</string>
 | 
				
			||||||
        </property>
 | 
					        </property>
 | 
				
			||||||
        <property name="icon">
 | 
					        <property name="icon">
 | 
				
			||||||
         <iconset resource="../icons.qrc">
 | 
					         <iconset>
 | 
				
			||||||
          <normaloff>:/icons/icons/关闭_close-one.svg</normaloff>:/icons/icons/关闭_close-one.svg</iconset>
 | 
					          <normaloff>:/icons/icons/关闭_close-one.svg</normaloff>:/icons/icons/关闭_close-one.svg</iconset>
 | 
				
			||||||
        </property>
 | 
					        </property>
 | 
				
			||||||
       </widget>
 | 
					       </widget>
 | 
				
			||||||
@ -275,7 +275,7 @@
 | 
				
			|||||||
         <string>apply</string>
 | 
					         <string>apply</string>
 | 
				
			||||||
        </property>
 | 
					        </property>
 | 
				
			||||||
        <property name="icon">
 | 
					        <property name="icon">
 | 
				
			||||||
         <iconset resource="../icons.qrc">
 | 
					         <iconset>
 | 
				
			||||||
          <normaloff>:/icons/icons/校验_check-one.svg</normaloff>:/icons/icons/校验_check-one.svg</iconset>
 | 
					          <normaloff>:/icons/icons/校验_check-one.svg</normaloff>:/icons/icons/校验_check-one.svg</iconset>
 | 
				
			||||||
        </property>
 | 
					        </property>
 | 
				
			||||||
       </widget>
 | 
					       </widget>
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
# -*- coding: utf-8 -*-
 | 
					# -*- coding: utf-8 -*-
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Form implementation generated from reading ui file '/home/super/PycharmProjects/ISAT_with_segment_anything/ui/setting_dialog.ui'
 | 
					# Form implementation generated from reading ui file 'setting_dialog.ui'
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Created by: PyQt5 UI code generator 5.15.7
 | 
					# Created by: PyQt5 UI code generator 5.15.7
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@ -81,12 +81,12 @@ class Ui_Dialog(object):
 | 
				
			|||||||
        self.horizontalLayout_2.addWidget(self.pushButton_export)
 | 
					        self.horizontalLayout_2.addWidget(self.pushButton_export)
 | 
				
			||||||
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
 | 
					        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
 | 
				
			||||||
        self.horizontalLayout_2.addItem(spacerItem)
 | 
					        self.horizontalLayout_2.addItem(spacerItem)
 | 
				
			||||||
        self.cache_button = QtWidgets.QPushButton(self.widget)
 | 
					        self.cancel_button = QtWidgets.QPushButton(self.widget)
 | 
				
			||||||
        icon3 = QtGui.QIcon()
 | 
					        icon3 = QtGui.QIcon()
 | 
				
			||||||
        icon3.addPixmap(QtGui.QPixmap(":/icons/icons/关闭_close-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
					        icon3.addPixmap(QtGui.QPixmap(":/icons/icons/关闭_close-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
				
			||||||
        self.cache_button.setIcon(icon3)
 | 
					        self.cancel_button.setIcon(icon3)
 | 
				
			||||||
        self.cache_button.setObjectName("cache_button")
 | 
					        self.cancel_button.setObjectName("cancel_button")
 | 
				
			||||||
        self.horizontalLayout_2.addWidget(self.cache_button)
 | 
					        self.horizontalLayout_2.addWidget(self.cancel_button)
 | 
				
			||||||
        self.apply_button = QtWidgets.QPushButton(self.widget)
 | 
					        self.apply_button = QtWidgets.QPushButton(self.widget)
 | 
				
			||||||
        icon4 = QtGui.QIcon()
 | 
					        icon4 = QtGui.QIcon()
 | 
				
			||||||
        icon4.addPixmap(QtGui.QPixmap(":/icons/icons/校验_check-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
					        icon4.addPixmap(QtGui.QPixmap(":/icons/icons/校验_check-one.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
 | 
				
			||||||
@ -106,6 +106,6 @@ class Ui_Dialog(object):
 | 
				
			|||||||
        self.add_button.setText(_translate("Dialog", "Add new label"))
 | 
					        self.add_button.setText(_translate("Dialog", "Add new label"))
 | 
				
			||||||
        self.pushButton_import.setText(_translate("Dialog", "Import"))
 | 
					        self.pushButton_import.setText(_translate("Dialog", "Import"))
 | 
				
			||||||
        self.pushButton_export.setText(_translate("Dialog", "Export"))
 | 
					        self.pushButton_export.setText(_translate("Dialog", "Export"))
 | 
				
			||||||
        self.cache_button.setText(_translate("Dialog", "Cache"))
 | 
					        self.cancel_button.setText(_translate("Dialog", "Cancel"))
 | 
				
			||||||
        self.apply_button.setText(_translate("Dialog", "Apply"))
 | 
					        self.apply_button.setText(_translate("Dialog", "Apply"))
 | 
				
			||||||
import icons_rc
 | 
					import icons_rc
 | 
				
			||||||
 | 
				
			|||||||
@ -150,9 +150,9 @@
 | 
				
			|||||||
         </spacer>
 | 
					         </spacer>
 | 
				
			||||||
        </item>
 | 
					        </item>
 | 
				
			||||||
        <item>
 | 
					        <item>
 | 
				
			||||||
         <widget class="QPushButton" name="cache_button">
 | 
					         <widget class="QPushButton" name="cancel_button">
 | 
				
			||||||
          <property name="text">
 | 
					          <property name="text">
 | 
				
			||||||
           <string>Cache</string>
 | 
					           <string>Cancel</string>
 | 
				
			||||||
          </property>
 | 
					          </property>
 | 
				
			||||||
          <property name="icon">
 | 
					          <property name="icon">
 | 
				
			||||||
           <iconset>
 | 
					           <iconset>
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										
											BIN
										
									
								
								ui/zh_CN.qm
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								ui/zh_CN.qm
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							@ -40,7 +40,7 @@
 | 
				
			|||||||
    </message>
 | 
					    </message>
 | 
				
			||||||
    <message>
 | 
					    <message>
 | 
				
			||||||
        <location filename="ISAT_to_VOC_dialog.py" line="121"/>
 | 
					        <location filename="ISAT_to_VOC_dialog.py" line="121"/>
 | 
				
			||||||
        <source>cache</source>
 | 
					        <source>cancel</source>
 | 
				
			||||||
        <translation>取消</translation>
 | 
					        <translation>取消</translation>
 | 
				
			||||||
    </message>
 | 
					    </message>
 | 
				
			||||||
    <message>
 | 
					    <message>
 | 
				
			||||||
@ -295,7 +295,7 @@
 | 
				
			|||||||
    </message>
 | 
					    </message>
 | 
				
			||||||
    <message>
 | 
					    <message>
 | 
				
			||||||
        <location filename="setting_dialog.py" line="109"/>
 | 
					        <location filename="setting_dialog.py" line="109"/>
 | 
				
			||||||
        <source>Cache</source>
 | 
					        <source>Cancel</source>
 | 
				
			||||||
        <translation>取消</translation>
 | 
					        <translation>取消</translation>
 | 
				
			||||||
    </message>
 | 
					    </message>
 | 
				
			||||||
    <message>
 | 
					    <message>
 | 
				
			||||||
 | 
				
			|||||||
@ -47,8 +47,8 @@ class COCOtoISATDialog(QtWidgets.QDialog, Ui_Dialog):
 | 
				
			|||||||
        else:
 | 
					        else:
 | 
				
			||||||
            self.lineEdit_save_root.clear()
 | 
					            self.lineEdit_save_root.clear()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def cache(self):
 | 
					    def cancel(self):
 | 
				
			||||||
        self.converter.cache = True
 | 
					        self.converter.cancel = True
 | 
				
			||||||
        self.close()
 | 
					        self.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def apply(self):
 | 
					    def apply(self):
 | 
				
			||||||
@ -62,7 +62,7 @@ class COCOtoISATDialog(QtWidgets.QDialog, Ui_Dialog):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        self.progressBar.reset()
 | 
					        self.progressBar.reset()
 | 
				
			||||||
        self.textBrowser.clear()
 | 
					        self.textBrowser.clear()
 | 
				
			||||||
        self.converter.cache = False
 | 
					        self.converter.cancel = False
 | 
				
			||||||
        self.converter.coco_json_path = self.label_path
 | 
					        self.converter.coco_json_path = self.label_path
 | 
				
			||||||
        self.converter.to_root = self.save_root
 | 
					        self.converter.to_root = self.save_root
 | 
				
			||||||
        self.converter.keep_crowd = self.checkBox_keepcrowd.isChecked()
 | 
					        self.converter.keep_crowd = self.checkBox_keepcrowd.isChecked()
 | 
				
			||||||
@ -85,4 +85,4 @@ class COCOtoISATDialog(QtWidgets.QDialog, Ui_Dialog):
 | 
				
			|||||||
        self.pushButton_label_path.clicked.connect(self._label_path)
 | 
					        self.pushButton_label_path.clicked.connect(self._label_path)
 | 
				
			||||||
        self.pushButton_save_root.clicked.connect(self._save_root)
 | 
					        self.pushButton_save_root.clicked.connect(self._save_root)
 | 
				
			||||||
        self.pushButton_apply.clicked.connect(self.apply)
 | 
					        self.pushButton_apply.clicked.connect(self.apply)
 | 
				
			||||||
        self.pushButton_cache.clicked.connect(self.cache)
 | 
					        self.pushButton_cancel.clicked.connect(self.cancel)
 | 
				
			||||||
@ -44,8 +44,8 @@ class ISATtoCOCODialog(QtWidgets.QDialog, Ui_Dialog):
 | 
				
			|||||||
        else:
 | 
					        else:
 | 
				
			||||||
            self.lineEdit_save_path.clear()
 | 
					            self.lineEdit_save_path.clear()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def cache(self):
 | 
					    def cancel(self):
 | 
				
			||||||
        self.converter.cache = True
 | 
					        self.converter.cancel = True
 | 
				
			||||||
        self.close()
 | 
					        self.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def apply(self):
 | 
					    def apply(self):
 | 
				
			||||||
@ -58,7 +58,7 @@ class ISATtoCOCODialog(QtWidgets.QDialog, Ui_Dialog):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        self.progressBar.reset()
 | 
					        self.progressBar.reset()
 | 
				
			||||||
        self.textBrowser.clear()
 | 
					        self.textBrowser.clear()
 | 
				
			||||||
        self.converter.cache = False
 | 
					        self.converter.cancel = False
 | 
				
			||||||
        self.converter.isat_json_root = self.label_root
 | 
					        self.converter.isat_json_root = self.label_root
 | 
				
			||||||
        self.converter.to_path = self.save_path
 | 
					        self.converter.to_path = self.save_path
 | 
				
			||||||
        self.converter.start()
 | 
					        self.converter.start()
 | 
				
			||||||
@ -79,4 +79,4 @@ class ISATtoCOCODialog(QtWidgets.QDialog, Ui_Dialog):
 | 
				
			|||||||
        self.pushButton_label_root.clicked.connect(self._label_root)
 | 
					        self.pushButton_label_root.clicked.connect(self._label_root)
 | 
				
			||||||
        self.pushButton_save_path.clicked.connect(self._save_path)
 | 
					        self.pushButton_save_path.clicked.connect(self._save_path)
 | 
				
			||||||
        self.pushButton_apply.clicked.connect(self.apply)
 | 
					        self.pushButton_apply.clicked.connect(self.apply)
 | 
				
			||||||
        self.pushButton_cache.clicked.connect(self.cache)
 | 
					        self.pushButton_cancel.clicked.connect(self.cancel)
 | 
				
			||||||
@ -47,8 +47,8 @@ class ISATtoVOCDialog(QtWidgets.QDialog, Ui_Dialog):
 | 
				
			|||||||
        else:
 | 
					        else:
 | 
				
			||||||
            self.lineEdit_save_root.clear()
 | 
					            self.lineEdit_save_root.clear()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def cache(self):
 | 
					    def cancel(self):
 | 
				
			||||||
        self.converter.cache = True
 | 
					        self.converter.cancel = True
 | 
				
			||||||
        self.close()
 | 
					        self.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def apply(self):
 | 
					    def apply(self):
 | 
				
			||||||
@ -68,7 +68,7 @@ class ISATtoVOCDialog(QtWidgets.QDialog, Ui_Dialog):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        self.progressBar.reset()
 | 
					        self.progressBar.reset()
 | 
				
			||||||
        self.textBrowser.clear()
 | 
					        self.textBrowser.clear()
 | 
				
			||||||
        self.converter.cache = False
 | 
					        self.converter.cancel = False
 | 
				
			||||||
        if os.path.exists(os.path.join(self.label_root, 'isat.yaml')):
 | 
					        if os.path.exists(os.path.join(self.label_root, 'isat.yaml')):
 | 
				
			||||||
            self.converter.cfg = load_config(os.path.join(self.label_root, 'isat.yaml'))
 | 
					            self.converter.cfg = load_config(os.path.join(self.label_root, 'isat.yaml'))
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
@ -97,4 +97,4 @@ class ISATtoVOCDialog(QtWidgets.QDialog, Ui_Dialog):
 | 
				
			|||||||
        self.pushButton_label_root.clicked.connect(self._label_root)
 | 
					        self.pushButton_label_root.clicked.connect(self._label_root)
 | 
				
			||||||
        self.pushButton_save_root.clicked.connect(self._save_root)
 | 
					        self.pushButton_save_root.clicked.connect(self._save_root)
 | 
				
			||||||
        self.pushButton_apply.clicked.connect(self.apply)
 | 
					        self.pushButton_apply.clicked.connect(self.apply)
 | 
				
			||||||
        self.pushButton_cache.clicked.connect(self.cache)
 | 
					        self.pushButton_cancel.clicked.connect(self.cancel)
 | 
				
			||||||
@ -347,9 +347,7 @@ class AnnotationScene(QtWidgets.QGraphicsScene):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        # 状态栏,显示当前坐标
 | 
					        # 状态栏,显示当前坐标
 | 
				
			||||||
        if self.image_data is not None:
 | 
					        if self.image_data is not None:
 | 
				
			||||||
            print('-- ', pos.x(), pos.y())
 | 
					 | 
				
			||||||
            x, y = round(pos.x()), round(pos.y())
 | 
					            x, y = round(pos.x()), round(pos.y())
 | 
				
			||||||
            print('---', x, y)
 | 
					 | 
				
			||||||
            self.mainwindow.labelCoord.setText('xy: ({:>4d},{:>4d})'.format(x, y))
 | 
					            self.mainwindow.labelCoord.setText('xy: ({:>4d},{:>4d})'.format(x, y))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            data = self.image_data[y][x]
 | 
					            data = self.image_data[y][x]
 | 
				
			||||||
 | 
				
			|||||||
@ -20,7 +20,7 @@ class CategoryChoiceDialog(QtWidgets.QDialog, Ui_Dialog):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        self.listWidget.itemClicked.connect(self.get_category)
 | 
					        self.listWidget.itemClicked.connect(self.get_category)
 | 
				
			||||||
        self.pushButton_apply.clicked.connect(self.apply)
 | 
					        self.pushButton_apply.clicked.connect(self.apply)
 | 
				
			||||||
        self.pushButton_cache.clicked.connect(self.cache)
 | 
					        self.pushButton_cancel.clicked.connect(self.cancel)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.setWindowModality(QtCore.Qt.WindowModality.WindowModal)
 | 
					        self.setWindowModality(QtCore.Qt.WindowModality.WindowModal)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -94,12 +94,12 @@ class CategoryChoiceDialog(QtWidgets.QDialog, Ui_Dialog):
 | 
				
			|||||||
        self.scene.change_mode_to_view()
 | 
					        self.scene.change_mode_to_view()
 | 
				
			||||||
        self.close()
 | 
					        self.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def cache(self):
 | 
					    def cancel(self):
 | 
				
			||||||
        self.scene.cancel_draw()
 | 
					        self.scene.cancel_draw()
 | 
				
			||||||
        self.close()
 | 
					        self.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def closeEvent(self, a0: QtGui.QCloseEvent):
 | 
					    def closeEvent(self, a0: QtGui.QCloseEvent):
 | 
				
			||||||
        self.cache()
 | 
					        self.cancel()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def reject(self):
 | 
					    def reject(self):
 | 
				
			||||||
        self.cache()
 | 
					        self.cancel()
 | 
				
			||||||
 | 
				
			|||||||
@ -21,7 +21,7 @@ class CategoryEditDialog(QtWidgets.QDialog, Ui_Dialog):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        self.listWidget.itemClicked.connect(self.get_category)
 | 
					        self.listWidget.itemClicked.connect(self.get_category)
 | 
				
			||||||
        self.pushButton_apply.clicked.connect(self.apply)
 | 
					        self.pushButton_apply.clicked.connect(self.apply)
 | 
				
			||||||
        self.pushButton_cache.clicked.connect(self.cache)
 | 
					        self.pushButton_cancel.clicked.connect(self.cancel)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.setWindowModality(QtCore.Qt.WindowModality.WindowModal)
 | 
					        self.setWindowModality(QtCore.Qt.WindowModality.WindowModal)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -105,12 +105,12 @@ class CategoryEditDialog(QtWidgets.QDialog, Ui_Dialog):
 | 
				
			|||||||
        self.scene.change_mode_to_view()
 | 
					        self.scene.change_mode_to_view()
 | 
				
			||||||
        self.close()
 | 
					        self.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def cache(self):
 | 
					    def cancel(self):
 | 
				
			||||||
        self.scene.cancel_draw()
 | 
					        self.scene.cancel_draw()
 | 
				
			||||||
        self.close()
 | 
					        self.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def closeEvent(self, a0: QtGui.QCloseEvent):
 | 
					    def closeEvent(self, a0: QtGui.QCloseEvent):
 | 
				
			||||||
        self.cache()
 | 
					        self.cancel()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def reject(self):
 | 
					    def reject(self):
 | 
				
			||||||
        self.cache()
 | 
					        self.cancel()
 | 
				
			||||||
 | 
				
			|||||||
@ -1,11 +0,0 @@
 | 
				
			|||||||
# -*- coding: utf-8 -*-
 | 
					 | 
				
			||||||
# @Author  : LG
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ui.process_dialog import Ui_Dialog
 | 
					 | 
				
			||||||
from PyQt5 import QtGui, QtWidgets, QtCore
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
class PorcessDialog(QtWidgets.QDialog, Ui_Dialog):
 | 
					 | 
				
			||||||
    def __init__(self, parent):
 | 
					 | 
				
			||||||
        super(PorcessDialog, self).__init__(parent)
 | 
					 | 
				
			||||||
        self.setupUi(self)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@ -121,13 +121,13 @@ class SettingDialog(QtWidgets.QDialog, Ui_Dialog):
 | 
				
			|||||||
        self.mainwindow.reload_cfg()
 | 
					        self.mainwindow.reload_cfg()
 | 
				
			||||||
        self.close()
 | 
					        self.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def cache(self):
 | 
					    def cancel(self):
 | 
				
			||||||
        self.close()
 | 
					        self.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def init_connect(self):
 | 
					    def init_connect(self):
 | 
				
			||||||
        self.add_button.clicked.connect(self.add_new_category)
 | 
					        self.add_button.clicked.connect(self.add_new_category)
 | 
				
			||||||
        self.apply_button.clicked.connect(self.apply)
 | 
					        self.apply_button.clicked.connect(self.apply)
 | 
				
			||||||
        self.cache_button.clicked.connect(self.cache)
 | 
					        self.cancel_button.clicked.connect(self.cancel)
 | 
				
			||||||
        self.color_button.clicked.connect(self.choice_color)
 | 
					        self.color_button.clicked.connect(self.choice_color)
 | 
				
			||||||
        self.pushButton_import.clicked.connect(self.import_cfg)
 | 
					        self.pushButton_import.clicked.connect(self.import_cfg)
 | 
				
			||||||
        self.pushButton_export.clicked.connect(self.export_cfg)
 | 
					        self.pushButton_export.clicked.connect(self.export_cfg)
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user