添加转labelme格式的功能

This commit is contained in:
yatengLG 2023-06-12 22:21:12 +08:00
parent fff96f6d2f
commit fa046a9e40
25 changed files with 2337 additions and 2968 deletions

View File

@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.8 (ISAT_with_segment_anything)" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.6 (segment_anything_env)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

2
.idea/misc.xml generated
View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (ISAT_with_segment_anything)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6 (segment_anything_env)" project-jdk-type="Python SDK" />
</project>

View File

@ -22,3 +22,7 @@
#
- 优化了转换界面,以显示详细的转换进度
#
- 添加了ISAT格式json转LabelMe格式json的功能
- 优化部分界面

View File

@ -76,6 +76,7 @@ class Annotation:
self.objects.append(obj)
else:
# labelme格式json
print('Warning: Load LabelMe formate json.')
shapes = dataset.get('shapes', {})
for shape in shapes:
# 只加载多边形
@ -83,8 +84,8 @@ class Annotation:
if not is_polygon:
continue
category = shape.get('label', 'unknow')
group = shape.get('group_id', 0)
if group is None: group = 0
group = shape.get('group_id', '')
if group is None: group = ''
segmentation = shape.get('points', [])
iscrowd = shape.get('iscrowd', 0)
note = shape.get('note', '')

View File

@ -1,9 +1,9 @@
<RCC>
<qresource prefix="icon">
<file>icons/coco.ico</file>
<file>icons/voc.png</file>
<file>icons/眼睛_eyes.svg</file>
<file>icons/semantic.png</file>
<file>icons/VOC_32x32.png</file>
<file>icons/labelme_32x32.png</file>
<file>icons/coco.ico</file>
<file>icons/M_Favicon.ico</file>
<file>icons/instance.png</file>
<file>icons/转换文件夹1_folder-conversion-one.svg</file>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

BIN
icons/VOC_32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
icons/labelme_32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

File diff suppressed because it is too large Load Diff

90
tools/toLABELME.py Normal file
View File

@ -0,0 +1,90 @@
# -*- coding: utf-8 -*-
# @Author : LG
from PyQt5.QtCore import QThread, pyqtSignal
from json import load, dump
import numpy as np
import os
class TOLABELME(QThread):
message = pyqtSignal(int, int, str)
def __init__(self,):
super(TOLABELME, self).__init__()
self.cfg = None
self.from_root = None
self.to_root = None
self.keep_crowd = False
self.cancel = False
def run(self):
jsons = [f for f in os.listdir(self.from_root) if f.endswith('.json')]
num_jsons = len(jsons)
self.message.emit(None, None, 'Start convert.')
for index, json in enumerate(jsons):
if self.cancel:
return
from_path = os.path.join(self.from_root, json)
self.message.emit(index+1, num_jsons, '{:>8d}/{:<8d} | Loading ISAT json:{}'.format(index+1, num_jsons, json))
with open(from_path, 'r') as f:
dataset = load(f)
info = dataset.get('info', {})
objects = dataset.get('objects', [])
img_name = info.get('name', '')
width = info.get('width', 0)
height = info.get('height', 0)
depth = info.get('depth', 0)
note = info.get('note', '')
objects = sorted(objects, key=lambda obj:obj.get('layer', 1))
labelme_anno = {}
labelme_anno['version'] = "5.2.0.post4 | ISAT to LabelMe"
labelme_anno['imagePath'] = img_name
labelme_anno['imageData'] = None
labelme_anno['imageHeight'] = height
labelme_anno['imageWidth'] = width
labelme_anno['flags'] = {}
labelme_anno['shapes'] = []
for obj in objects:
category = obj.get('category', 'unknow')
group = obj.get('group', '')
segmentation = obj.get('segmentation', [])
iscrowd = obj.get('iscrowd', 0)
if iscrowd:
if not self.keep_crowd:
continue
note = obj.get('note', '')
area = obj.get('area', 0)
layer = obj.get('layer', 1)
bbox = obj.get('bbox', [])
shape = {}
shape['label'] = category
shape['points'] = segmentation
shape['group_id'] = int(group) if group else None
shape['description'] = note
shape['shape_type'] = 'polygon'
shape['flags'] = {}
labelme_anno['shapes'].append(shape)
to_path = os.path.join(self.to_root, json)
with open(to_path, 'w') as f:
try:
dump(labelme_anno, f, indent=4)
self.message.emit(None, None, ' ' * 18 + '| Saved labelme json: {}'.format(to_path))
except Exception as e:
self.message.emit(None, None, ' ' * 18 + '| Error: {}'.format(e))
self.message.emit(None, None, '*** Finished! ***')
def __del__(self):
self.wait()

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'COCO_to_ISAT_dialog.ui'
# Form implementation generated from reading ui file '/home/super/PycharmProjects/ISAT_with_segment_anything/ui/COCO_to_ISAT_dialog.ui'
#
# Created by: PyQt5 UI code generator 5.15.7
#
@ -80,6 +80,10 @@ class Ui_Dialog(object):
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.label = QtWidgets.QLabel(self.widget_2)
font = QtGui.QFont()
font.setFamily("Times New Roman")
font.setPointSize(12)
self.label.setFont(font)
self.label.setStyleSheet("color: rgb(255, 0, 0);")
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)

View File

@ -179,6 +179,12 @@
</property>
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<family>Times New Roman</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0);</string>
</property>

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ISAT_to_COCO_dialog.ui'
# Form implementation generated from reading ui file '/home/super/PycharmProjects/ISAT_with_segment_anything/ui/ISAT_to_COCO_dialog.ui'
#
# Created by: PyQt5 UI code generator 5.15.7
#
@ -69,6 +69,10 @@ class Ui_Dialog(object):
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.label = QtWidgets.QLabel(self.widget_2)
font = QtGui.QFont()
font.setFamily("Times New Roman")
font.setPointSize(12)
self.label.setFont(font)
self.label.setStyleSheet("color: rgb(255, 0, 0);")
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)

View File

@ -148,6 +148,12 @@ p, li { white-space: pre-wrap; }
</property>
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<family>Times New Roman</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0);</string>
</property>

View File

@ -0,0 +1,107 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/super/PycharmProjects/ISAT_with_segment_anything/ui/ISAT_to_LABELME_dialog.ui'
#
# Created by: PyQt5 UI code generator 5.15.7
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(600, 251)
font = QtGui.QFont()
font.setFamily("Times New Roman")
font.setPointSize(12)
Dialog.setFont(font)
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName("verticalLayout")
self.widget = QtWidgets.QWidget(Dialog)
self.widget.setObjectName("widget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.widget)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.lineEdit_fromroot = QtWidgets.QLineEdit(self.widget)
self.lineEdit_fromroot.setText("")
self.lineEdit_fromroot.setObjectName("lineEdit_fromroot")
self.horizontalLayout.addWidget(self.lineEdit_fromroot)
self.pushButton_fromroot = QtWidgets.QPushButton(self.widget)
self.pushButton_fromroot.setMinimumSize(QtCore.QSize(100, 0))
self.pushButton_fromroot.setObjectName("pushButton_fromroot")
self.horizontalLayout.addWidget(self.pushButton_fromroot)
self.verticalLayout.addWidget(self.widget)
self.widget_2 = QtWidgets.QWidget(Dialog)
self.widget_2.setObjectName("widget_2")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.widget_2)
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.lineEdit_toroot = QtWidgets.QLineEdit(self.widget_2)
self.lineEdit_toroot.setObjectName("lineEdit_toroot")
self.horizontalLayout_2.addWidget(self.lineEdit_toroot)
self.pushButton_toroot = QtWidgets.QPushButton(self.widget_2)
self.pushButton_toroot.setMinimumSize(QtCore.QSize(100, 0))
self.pushButton_toroot.setObjectName("pushButton_toroot")
self.horizontalLayout_2.addWidget(self.pushButton_toroot)
self.verticalLayout.addWidget(self.widget_2)
self.widget_3 = QtWidgets.QWidget(Dialog)
self.widget_3.setObjectName("widget_3")
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.widget_3)
self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
spacerItem = QtWidgets.QSpacerItem(469, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(spacerItem)
self.checkBox_keepcrowd = QtWidgets.QCheckBox(self.widget_3)
self.checkBox_keepcrowd.setObjectName("checkBox_keepcrowd")
self.horizontalLayout_3.addWidget(self.checkBox_keepcrowd)
self.verticalLayout.addWidget(self.widget_3)
self.textBrowser = QtWidgets.QTextBrowser(Dialog)
font = QtGui.QFont()
font.setFamily("宋体")
self.textBrowser.setFont(font)
self.textBrowser.setObjectName("textBrowser")
self.verticalLayout.addWidget(self.textBrowser)
self.progressBar = QtWidgets.QProgressBar(Dialog)
self.progressBar.setProperty("value", 24)
self.progressBar.setObjectName("progressBar")
self.verticalLayout.addWidget(self.progressBar)
self.widget_4 = QtWidgets.QWidget(Dialog)
self.widget_4.setObjectName("widget_4")
self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.widget_4)
self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.label = QtWidgets.QLabel(self.widget_4)
font = QtGui.QFont()
font.setPointSize(12)
self.label.setFont(font)
self.label.setStyleSheet("color: rgb(255, 0, 0);")
self.label.setObjectName("label")
self.horizontalLayout_4.addWidget(self.label)
spacerItem1 = QtWidgets.QSpacerItem(191, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem1)
self.pushButton_cancel = QtWidgets.QPushButton(self.widget_4)
self.pushButton_cancel.setObjectName("pushButton_cancel")
self.horizontalLayout_4.addWidget(self.pushButton_cancel)
self.pushButton_apply = QtWidgets.QPushButton(self.widget_4)
self.pushButton_apply.setObjectName("pushButton_apply")
self.horizontalLayout_4.addWidget(self.pushButton_apply)
self.verticalLayout.addWidget(self.widget_4)
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "ISAT to LabelMe"))
self.lineEdit_fromroot.setPlaceholderText(_translate("Dialog", "ISAT jsons root"))
self.pushButton_fromroot.setText(_translate("Dialog", "Jsons root"))
self.lineEdit_toroot.setPlaceholderText(_translate("Dialog", "LabelMe jsons save root"))
self.pushButton_toroot.setText(_translate("Dialog", "Save root"))
self.checkBox_keepcrowd.setText(_translate("Dialog", "Keep crowd"))
self.label.setText(_translate("Dialog", "Convert ISAT annotations to LabelMe json."))
self.pushButton_cancel.setText(_translate("Dialog", "cancel"))
self.pushButton_apply.setText(_translate("Dialog", "convert"))

View File

@ -0,0 +1,220 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>251</height>
</rect>
</property>
<property name="font">
<font>
<family>Times New Roman</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="windowTitle">
<string>ISAT to LabelMe</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="lineEdit_fromroot">
<property name="text">
<string/>
</property>
<property name="placeholderText">
<string>ISAT jsons root</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_fromroot">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Jsons root</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="lineEdit_toroot">
<property name="placeholderText">
<string>LabelMe jsons save root</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_toroot">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Save root</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_3" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>469</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBox_keepcrowd">
<property name="text">
<string>Keep crowd</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QTextBrowser" name="textBrowser">
<property name="font">
<font>
<family>宋体</family>
</font>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBar">
<property name="value">
<number>24</number>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_4" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0);</string>
</property>
<property name="text">
<string>Convert ISAT annotations to LabelMe json.</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>191</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_cancel">
<property name="text">
<string>cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_apply">
<property name="text">
<string>convert</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ISAT_to_VOC_dialog.ui'
# Form implementation generated from reading ui file '/home/super/PycharmProjects/ISAT_with_segment_anything/ui/ISAT_to_VOC_dialog.ui'
#
# Created by: PyQt5 UI code generator 5.15.7
#
@ -81,6 +81,10 @@ class Ui_Dialog(object):
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.label = QtWidgets.QLabel(self.widget_2)
font = QtGui.QFont()
font.setFamily("Times New Roman")
font.setPointSize(12)
self.label.setFont(font)
self.label.setStyleSheet("color: rgb(255, 0, 0);")
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)

View File

@ -185,6 +185,12 @@ p, li { white-space: pre-wrap; }
</property>
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<family>Times New Roman</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0);</string>
</property>

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'MainWindow.ui'
# Form implementation generated from reading ui file '/home/super/PycharmProjects/ISAT_with_segment_anything/ui/MainWindow.ui'
#
# Created by: PyQt5 UI code generator 5.15.7
#
@ -32,7 +32,7 @@ class Ui_MainWindow(object):
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setEnabled(True)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1280, 25))
self.menubar.setGeometry(QtCore.QRect(0, 0, 1280, 24))
font = QtGui.QFont()
font.setFamily("Times New Roman")
font.setPointSize(12)
@ -212,7 +212,7 @@ class Ui_MainWindow(object):
self.actionTo_bottom.setObjectName("actionTo_bottom")
self.actionToVOC = QtWidgets.QAction(MainWindow)
icon19 = QtGui.QIcon()
icon19.addPixmap(QtGui.QPixmap(":/icon/icons/voc.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
icon19.addPixmap(QtGui.QPixmap(":/icon/icons/VOC_32x32.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionToVOC.setIcon(icon19)
self.actionToVOC.setWhatsThis("")
self.actionToVOC.setObjectName("actionToVOC")
@ -263,6 +263,11 @@ class Ui_MainWindow(object):
self.actionFromCOCO = QtWidgets.QAction(MainWindow)
self.actionFromCOCO.setIcon(icon25)
self.actionFromCOCO.setObjectName("actionFromCOCO")
self.actionTo_LabelMe = QtWidgets.QAction(MainWindow)
icon26 = QtGui.QIcon()
icon26.addPixmap(QtGui.QPixmap(":/icon/icons/labelme_32x32.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionTo_LabelMe.setIcon(icon26)
self.actionTo_LabelMe.setObjectName("actionTo_LabelMe")
self.menuFile.addAction(self.actionOpen_dir)
self.menuFile.addAction(self.actionSave_dir)
self.menuFile.addSeparator()
@ -285,6 +290,8 @@ class Ui_MainWindow(object):
self.menuAbout.addAction(self.actionAbout)
self.menuTools.addAction(self.actionToVOC)
self.menuTools.addAction(self.actionToCOCO)
self.menuTools.addAction(self.actionTo_LabelMe)
self.menuTools.addSeparator()
self.menuTools.addAction(self.actionFromCOCO)
self.menuEdit.addAction(self.actionSegment_anything)
self.menuEdit.addAction(self.actionPolygon)
@ -395,7 +402,7 @@ class Ui_MainWindow(object):
self.actionTo_bottom.setShortcut(_translate("MainWindow", "B"))
self.actionToVOC.setText(_translate("MainWindow", "To VOC"))
self.actionToVOC.setToolTip(_translate("MainWindow", "Convert ISAT to VOC"))
self.actionToVOC.setStatusTip(_translate("MainWindow", "Convert ISAT jsons to VOC png image."))
self.actionToVOC.setStatusTip(_translate("MainWindow", "Convert ISAT jsons to VOC png images."))
self.actionChinese.setText(_translate("MainWindow", "中文"))
self.actionEnglish.setText(_translate("MainWindow", "English"))
self.actionBackspace.setText(_translate("MainWindow", "Backspace"))
@ -423,4 +430,7 @@ class Ui_MainWindow(object):
self.actionFromCOCO.setText(_translate("MainWindow", "From COCO"))
self.actionFromCOCO.setToolTip(_translate("MainWindow", "Convert COCO to ISAT"))
self.actionFromCOCO.setStatusTip(_translate("MainWindow", "Convert COCO json to ISAT jsons."))
self.actionTo_LabelMe.setText(_translate("MainWindow", "To LabelMe"))
self.actionTo_LabelMe.setToolTip(_translate("MainWindow", "Convert ISAT to LabelMe"))
self.actionTo_LabelMe.setStatusTip(_translate("MainWindow", "Convert ISAT jsons to LabelMe jsons."))
import icons_rc

View File

@ -57,7 +57,7 @@
<x>0</x>
<y>0</y>
<width>1280</width>
<height>25</height>
<height>24</height>
</rect>
</property>
<property name="font">
@ -152,6 +152,8 @@
</property>
<addaction name="actionToVOC"/>
<addaction name="actionToCOCO"/>
<addaction name="actionTo_LabelMe"/>
<addaction name="separator"/>
<addaction name="actionFromCOCO"/>
</widget>
<widget class="QMenu" name="menuEdit">
@ -574,7 +576,7 @@
<action name="actionToVOC">
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icon/icons/voc.png</normaloff>:/icon/icons/voc.png</iconset>
<normaloff>:/icon/icons/VOC_32x32.png</normaloff>:/icon/icons/VOC_32x32.png</iconset>
</property>
<property name="text">
<string>To VOC</string>
@ -583,7 +585,7 @@
<string>Convert ISAT to VOC</string>
</property>
<property name="statusTip">
<string>Convert ISAT jsons to VOC png image.</string>
<string>Convert ISAT jsons to VOC png images.</string>
</property>
<property name="whatsThis">
<string/>
@ -691,7 +693,7 @@
</action>
<action name="actionVisible">
<property name="icon">
<iconset resource="../icons.qrc">
<iconset>
<normaloff>:/icon/icons/眼睛_eyes.svg</normaloff>:/icon/icons/眼睛_eyes.svg</iconset>
</property>
<property name="text">
@ -734,6 +736,21 @@
<string>Convert COCO json to ISAT jsons.</string>
</property>
</action>
<action name="actionTo_LabelMe">
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icon/icons/labelme_32x32.png</normaloff>:/icon/icons/labelme_32x32.png</iconset>
</property>
<property name="text">
<string>To LabelMe</string>
</property>
<property name="toolTip">
<string>Convert ISAT to LabelMe</string>
</property>
<property name="statusTip">
<string>Convert ISAT jsons to LabelMe jsons.</string>
</property>
</action>
</widget>
<resources>
<include location="../icons.qrc"/>

Binary file not shown.

View File

@ -39,7 +39,7 @@
<translation>:</translation>
</message>
<message>
<location filename="ISAT_to_VOC_dialog.py" line="121"/>
<location filename="ISAT_to_VOC_dialog.py" line="125"/>
<source>cancel</source>
<translation></translation>
</message>
@ -54,12 +54,12 @@
<translation type="obsolete">ISAT标签文件转png</translation>
</message>
<message>
<location filename="ISAT_to_VOC_dialog.py" line="112"/>
<location filename="ISAT_to_VOC_dialog.py" line="116"/>
<source>png save root</source>
<translation></translation>
</message>
<message>
<location filename="ISAT_to_VOC_dialog.py" line="109"/>
<location filename="ISAT_to_VOC_dialog.py" line="113"/>
<source>Save root</source>
<translation></translation>
</message>
@ -69,12 +69,12 @@
<translation type="obsolete"></translation>
</message>
<message>
<location filename="ISAT_to_VOC_dialog.py" line="110"/>
<location filename="ISAT_to_VOC_dialog.py" line="114"/>
<source>ISAT jsons root</source>
<translation></translation>
</message>
<message>
<location filename="ISAT_to_VOC_dialog.py" line="111"/>
<location filename="ISAT_to_VOC_dialog.py" line="115"/>
<source>Label root</source>
<translation></translation>
</message>
@ -84,7 +84,7 @@
<translation type="obsolete">ISAT标注文件转换为png图片.</translation>
</message>
<message>
<location filename="ISAT_to_VOC_dialog.py" line="122"/>
<location filename="ISAT_to_VOC_dialog.py" line="126"/>
<source>convert</source>
<translation></translation>
</message>
@ -326,7 +326,7 @@
<message>
<location filename="about_dialog.py" line="74"/>
<source>ISAT with Segment anything.</source>
<translation>ISAT集成Segment anything.</translation>
<translation>ISAT with Segment anything.</translation>
</message>
<message>
<location filename="about_dialog.py" line="75"/>
@ -420,57 +420,57 @@ http://www.yatenglg.cn/isat</source>
<translation></translation>
</message>
<message>
<location filename="COCO_to_ISAT_dialog.py" line="107"/>
<location filename="COCO_to_ISAT_dialog.py" line="111"/>
<source>COCO to ISAT</source>
<translation>COCO转ISAT</translation>
</message>
<message>
<location filename="COCO_to_ISAT_dialog.py" line="109"/>
<location filename="COCO_to_ISAT_dialog.py" line="113"/>
<source>Json path</source>
<translation>Json路径</translation>
</message>
<message>
<location filename="COCO_to_ISAT_dialog.py" line="110"/>
<location filename="COCO_to_ISAT_dialog.py" line="114"/>
<source>ISAT jsons save root</source>
<translation></translation>
</message>
<message>
<location filename="COCO_to_ISAT_dialog.py" line="111"/>
<location filename="COCO_to_ISAT_dialog.py" line="115"/>
<source>COCO json path</source>
<translation></translation>
</message>
<message>
<location filename="ISAT_to_VOC_dialog.py" line="114"/>
<location filename="ISAT_to_VOC_dialog.py" line="118"/>
<source>Keep crowd</source>
<translation></translation>
</message>
<message>
<location filename="COCO_to_ISAT_dialog.py" line="113"/>
<location filename="COCO_to_ISAT_dialog.py" line="117"/>
<source>Convert COCO json to ISAT jsons.All layer attr is 1.</source>
<translation>COCO格式json转为ISAT格式json,1</translation>
</message>
<message>
<location filename="ISAT_to_COCO_dialog.py" line="96"/>
<location filename="ISAT_to_COCO_dialog.py" line="100"/>
<source>ISAT to COCO</source>
<translation>ISAT转COCO</translation>
</message>
<message>
<location filename="ISAT_to_COCO_dialog.py" line="97"/>
<location filename="ISAT_to_COCO_dialog.py" line="101"/>
<source>Save path</source>
<translation></translation>
</message>
<message>
<location filename="ISAT_to_COCO_dialog.py" line="98"/>
<location filename="ISAT_to_LABELME_dialog.py" line="101"/>
<source>Jsons root</source>
<translation>jsons目录</translation>
</message>
<message>
<location filename="ISAT_to_COCO_dialog.py" line="99"/>
<location filename="ISAT_to_COCO_dialog.py" line="103"/>
<source>COCO json save path</source>
<translation></translation>
</message>
<message>
<location filename="ISAT_to_COCO_dialog.py" line="101"/>
<location filename="ISAT_to_COCO_dialog.py" line="105"/>
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
@ -479,22 +479,22 @@ p, li { white-space: pre-wrap; }
<translation></translation>
</message>
<message>
<location filename="ISAT_to_COCO_dialog.py" line="106"/>
<location filename="ISAT_to_COCO_dialog.py" line="110"/>
<source>Convert ISAT jsons to COCO json.The layer attr will be lost.</source>
<translation>ISAT格式json转换为COCO格式json.</translation>
</message>
<message>
<location filename="ISAT_to_VOC_dialog.py" line="108"/>
<location filename="ISAT_to_VOC_dialog.py" line="112"/>
<source>ISAT to VOC png</source>
<translation>ISAT转VOC</translation>
</message>
<message>
<location filename="ISAT_to_VOC_dialog.py" line="113"/>
<location filename="ISAT_to_VOC_dialog.py" line="117"/>
<source>Is instance</source>
<translation></translation>
</message>
<message>
<location filename="ISAT_to_VOC_dialog.py" line="115"/>
<location filename="ISAT_to_VOC_dialog.py" line="119"/>
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
@ -503,10 +503,25 @@ p, li { white-space: pre-wrap; }
<translation></translation>
</message>
<message>
<location filename="ISAT_to_VOC_dialog.py" line="120"/>
<location filename="ISAT_to_VOC_dialog.py" line="124"/>
<source>Convert ISAT annotations to VOC png.</source>
<translation>ISAT格式json转换为VOC格式单通道png图片</translation>
</message>
<message>
<location filename="ISAT_to_LABELME_dialog.py" line="99"/>
<source>ISAT to LabelMe</source>
<translation>ISAT转LabelMe</translation>
</message>
<message>
<location filename="ISAT_to_LABELME_dialog.py" line="102"/>
<source>LabelMe jsons save root</source>
<translation></translation>
</message>
<message>
<location filename="ISAT_to_LABELME_dialog.py" line="105"/>
<source>Convert ISAT annotations to LabelMe json.</source>
<translation>ISAT格式json转换为LabelMe格式json</translation>
</message>
</context>
<context>
<name>Form</name>
@ -564,52 +579,52 @@ p, li { white-space: pre-wrap; }
<context>
<name>MainWindow</name>
<message>
<location filename="MainWindow.py" line="333"/>
<location filename="MainWindow.py" line="340"/>
<source>ISAT</source>
<translation>ISAT </translation>
</message>
<message>
<location filename="MainWindow.py" line="334"/>
<location filename="MainWindow.py" line="341"/>
<source>File</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="335"/>
<location filename="MainWindow.py" line="342"/>
<source>View</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="336"/>
<location filename="MainWindow.py" line="343"/>
<source>Help</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="338"/>
<location filename="MainWindow.py" line="345"/>
<source>Tools</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="385"/>
<location filename="MainWindow.py" line="392"/>
<source>Edit</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="340"/>
<location filename="MainWindow.py" line="347"/>
<source>toolBar</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="341"/>
<location filename="MainWindow.py" line="348"/>
<source>Info</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="342"/>
<location filename="MainWindow.py" line="349"/>
<source>Labels</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="343"/>
<location filename="MainWindow.py" line="350"/>
<source>Files</source>
<translation></translation>
</message>
@ -624,32 +639,32 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete"></translation>
</message>
<message>
<location filename="MainWindow.py" line="346"/>
<location filename="MainWindow.py" line="353"/>
<source>Zoom in</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="348"/>
<location filename="MainWindow.py" line="355"/>
<source>Zoom out</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="351"/>
<location filename="MainWindow.py" line="358"/>
<source>Fit window</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="353"/>
<location filename="MainWindow.py" line="360"/>
<source>F</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="354"/>
<location filename="MainWindow.py" line="361"/>
<source>Setting</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="357"/>
<location filename="MainWindow.py" line="364"/>
<source>Exit</source>
<translation>退</translation>
</message>
@ -659,12 +674,12 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete"></translation>
</message>
<message>
<location filename="MainWindow.py" line="361"/>
<location filename="MainWindow.py" line="368"/>
<source>Save</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="363"/>
<location filename="MainWindow.py" line="370"/>
<source>S</source>
<translation></translation>
</message>
@ -674,12 +689,12 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete"></translation>
</message>
<message>
<location filename="MainWindow.py" line="365"/>
<location filename="MainWindow.py" line="372"/>
<source>Prev image</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="367"/>
<location filename="MainWindow.py" line="374"/>
<source>A</source>
<translation></translation>
</message>
@ -689,17 +704,17 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete"></translation>
</message>
<message>
<location filename="MainWindow.py" line="369"/>
<location filename="MainWindow.py" line="376"/>
<source>Next image</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="371"/>
<location filename="MainWindow.py" line="378"/>
<source>D</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="373"/>
<location filename="MainWindow.py" line="380"/>
<source>About</source>
<translation></translation>
</message>
@ -714,72 +729,72 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete"></translation>
</message>
<message>
<location filename="MainWindow.py" line="416"/>
<location filename="MainWindow.py" line="423"/>
<source>C</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="378"/>
<location filename="MainWindow.py" line="385"/>
<source>Delete</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="379"/>
<location filename="MainWindow.py" line="386"/>
<source>Delete polygon</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="381"/>
<location filename="MainWindow.py" line="388"/>
<source>Del</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="382"/>
<location filename="MainWindow.py" line="389"/>
<source>Bit map</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="384"/>
<location filename="MainWindow.py" line="391"/>
<source>Space</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="386"/>
<location filename="MainWindow.py" line="393"/>
<source>Edit polygon</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="412"/>
<location filename="MainWindow.py" line="419"/>
<source>E</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="388"/>
<location filename="MainWindow.py" line="395"/>
<source>To top</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="389"/>
<location filename="MainWindow.py" line="396"/>
<source>Move polygon to top layer</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="391"/>
<location filename="MainWindow.py" line="398"/>
<source>T</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="392"/>
<location filename="MainWindow.py" line="399"/>
<source>To bottom</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="393"/>
<location filename="MainWindow.py" line="400"/>
<source>Move polygon to bottom layer</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="395"/>
<location filename="MainWindow.py" line="402"/>
<source>B</source>
<translation></translation>
</message>
@ -794,12 +809,12 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">ISAT标注文件转换为png图片.</translation>
</message>
<message>
<location filename="MainWindow.py" line="337"/>
<location filename="MainWindow.py" line="344"/>
<source>Laguage</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="372"/>
<location filename="MainWindow.py" line="379"/>
<source>Shortcut</source>
<translation></translation>
</message>
@ -809,52 +824,52 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete"></translation>
</message>
<message>
<location filename="MainWindow.py" line="400"/>
<location filename="MainWindow.py" line="407"/>
<source>English</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="399"/>
<location filename="MainWindow.py" line="406"/>
<source></source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="344"/>
<location filename="MainWindow.py" line="351"/>
<source>Images dir</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="345"/>
<location filename="MainWindow.py" line="352"/>
<source>Open images dir.</source>
<translation>.</translation>
</message>
<message>
<location filename="MainWindow.py" line="347"/>
<location filename="MainWindow.py" line="354"/>
<source>Zoom in.</source>
<translation>.</translation>
</message>
<message>
<location filename="MainWindow.py" line="349"/>
<location filename="MainWindow.py" line="356"/>
<source>Zoom out.</source>
<translation>.</translation>
</message>
<message>
<location filename="MainWindow.py" line="352"/>
<location filename="MainWindow.py" line="359"/>
<source>Fit window.</source>
<translation>.</translation>
</message>
<message>
<location filename="MainWindow.py" line="359"/>
<location filename="MainWindow.py" line="366"/>
<source>Label dir</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="360"/>
<location filename="MainWindow.py" line="367"/>
<source>Open label dir.</source>
<translation>.</translation>
</message>
<message>
<location filename="MainWindow.py" line="362"/>
<location filename="MainWindow.py" line="369"/>
<source>Save annotation.</source>
<translation>.</translation>
</message>
@ -869,7 +884,7 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">.</translation>
</message>
<message>
<location filename="MainWindow.py" line="370"/>
<location filename="MainWindow.py" line="377"/>
<source>Next image.</source>
<translation>.</translation>
</message>
@ -879,179 +894,199 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">.</translation>
</message>
<message>
<location filename="MainWindow.py" line="380"/>
<location filename="MainWindow.py" line="387"/>
<source>Delete polygon.</source>
<translation>.</translation>
</message>
<message>
<location filename="MainWindow.py" line="383"/>
<location filename="MainWindow.py" line="390"/>
<source>Show instance or segmeent state.</source>
<translation>.</translation>
</message>
<message>
<location filename="MainWindow.py" line="387"/>
<location filename="MainWindow.py" line="394"/>
<source>Edit polygon attribute.</source>
<translation>.</translation>
</message>
<message>
<location filename="MainWindow.py" line="390"/>
<location filename="MainWindow.py" line="397"/>
<source>Move polygon to top layer.</source>
<translation>.</translation>
</message>
<message>
<location filename="MainWindow.py" line="394"/>
<location filename="MainWindow.py" line="401"/>
<source>Move polygon to bottom layer.</source>
<translation>.</translation>
</message>
<message>
<location filename="MainWindow.py" line="355"/>
<location filename="MainWindow.py" line="362"/>
<source>Setting.</source>
<translation>.</translation>
</message>
<message>
<location filename="MainWindow.py" line="358"/>
<location filename="MainWindow.py" line="365"/>
<source>Exit.</source>
<translation>退.</translation>
</message>
<message>
<location filename="MainWindow.py" line="366"/>
<location filename="MainWindow.py" line="373"/>
<source>Prev image.</source>
<translation>.</translation>
</message>
<message>
<location filename="MainWindow.py" line="375"/>
<location filename="MainWindow.py" line="382"/>
<source>Segment anything</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="376"/>
<location filename="MainWindow.py" line="383"/>
<source>Quick annotate using Segment anything.</source>
<translation>使Segment anything进行快速标注.</translation>
</message>
<message>
<location filename="MainWindow.py" line="377"/>
<location filename="MainWindow.py" line="384"/>
<source>Q</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="402"/>
<location filename="MainWindow.py" line="409"/>
<source>Backspace</source>
<translation>退</translation>
</message>
<message>
<location filename="MainWindow.py" line="403"/>
<location filename="MainWindow.py" line="410"/>
<source>Backspace.</source>
<translation>退.</translation>
</message>
<message>
<location filename="MainWindow.py" line="404"/>
<location filename="MainWindow.py" line="411"/>
<source>Z</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="405"/>
<location filename="MainWindow.py" line="412"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="406"/>
<location filename="MainWindow.py" line="413"/>
<source>Annotate canceled</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="407"/>
<location filename="MainWindow.py" line="414"/>
<source>Annotate canceled.</source>
<translation>.</translation>
</message>
<message>
<location filename="MainWindow.py" line="408"/>
<location filename="MainWindow.py" line="415"/>
<source>Esc</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="409"/>
<location filename="MainWindow.py" line="416"/>
<source>Finish</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="410"/>
<location filename="MainWindow.py" line="417"/>
<source>Annotate finished</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="411"/>
<location filename="MainWindow.py" line="418"/>
<source>Annotate finished.</source>
<translation>.</translation>
</message>
<message>
<location filename="MainWindow.py" line="413"/>
<location filename="MainWindow.py" line="420"/>
<source>Polygon</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="414"/>
<location filename="MainWindow.py" line="421"/>
<source>Draw polygon</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="415"/>
<location filename="MainWindow.py" line="422"/>
<source>Accurately annotate by drawing polygon. </source>
<translation>,. </translation>
</message>
<message>
<location filename="MainWindow.py" line="418"/>
<location filename="MainWindow.py" line="425"/>
<source>Visible</source>
<translation>/</translation>
</message>
<message>
<location filename="MainWindow.py" line="419"/>
<location filename="MainWindow.py" line="426"/>
<source>V</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="396"/>
<location filename="MainWindow.py" line="403"/>
<source>To VOC</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="397"/>
<location filename="MainWindow.py" line="404"/>
<source>Convert ISAT to VOC</source>
<translation>ISAT转VOC</translation>
</message>
<message>
<location filename="MainWindow.py" line="398"/>
<source>Convert ISAT jsons to VOC png image.</source>
<translation>ISAT格式json转换为VOC单通道png</translation>
<translation type="obsolete">ISAT格式json转换为VOC单通道png</translation>
</message>
<message>
<location filename="MainWindow.py" line="420"/>
<location filename="MainWindow.py" line="427"/>
<source>To COCO</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="421"/>
<location filename="MainWindow.py" line="428"/>
<source>Convert ISAT to COCO</source>
<translation>ISAT转COCO</translation>
</message>
<message>
<location filename="MainWindow.py" line="422"/>
<location filename="MainWindow.py" line="429"/>
<source>Convert ISAT jsons to COCO json.</source>
<translation>ISAT格式json转换为COCO格式json</translation>
</message>
<message>
<location filename="MainWindow.py" line="423"/>
<location filename="MainWindow.py" line="430"/>
<source>From COCO</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="424"/>
<location filename="MainWindow.py" line="431"/>
<source>Convert COCO to ISAT</source>
<translation>COCO转ISAT</translation>
</message>
<message>
<location filename="MainWindow.py" line="425"/>
<location filename="MainWindow.py" line="432"/>
<source>Convert COCO json to ISAT jsons.</source>
<translation>COCO格式json转换为ISAT格式json</translation>
</message>
<message>
<location filename="MainWindow.py" line="405"/>
<source>Convert ISAT jsons to VOC png images.</source>
<translation>ISAT格式json转换为VOC单通道png图片</translation>
</message>
<message>
<location filename="MainWindow.py" line="433"/>
<source>To LabelMe</source>
<translation></translation>
</message>
<message>
<location filename="MainWindow.py" line="434"/>
<source>Convert ISAT to LabelMe</source>
<translation>ISAT转LabelMe</translation>
</message>
<message>
<location filename="MainWindow.py" line="435"/>
<source>Convert ISAT jsons to LabelMe jsons.</source>
<translation>ISAT格式json转换为LabelMe格式json</translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,86 @@
# -*- coding: utf-8 -*-
# @Author : LG
from PyQt5 import QtWidgets, QtCore, QtGui
from ui.ISAT_to_LABELME_dialog import Ui_Dialog
from tools.toLABELME import TOLABELME
import os
class ISATtoLabelMeDialog(QtWidgets.QDialog, Ui_Dialog):
def __init__(self, parent, mainwindow):
super(ISATtoLabelMeDialog, self).__init__(parent)
self.setupUi(self)
self.mainwindow = mainwindow
self.label_root = None
self.save_root = None
self.converter = TOLABELME()
self.converter.message.connect(self.print_message)
self.setWindowModality(QtCore.Qt.WindowModality.WindowModal)
self.init_connect()
def reset_gui(self):
self.lineEdit_fromroot.clear()
self.lineEdit_toroot.clear()
self.checkBox_keepcrowd.setChecked(False)
self.textBrowser.clear()
self.progressBar.reset()
def _label_root(self):
dir = QtWidgets.QFileDialog.getExistingDirectory(self)
if dir:
self.label_root = dir
self.lineEdit_fromroot.setText(dir)
else:
self.lineEdit_fromroot.clear()
def _save_root(self):
dir = QtWidgets.QFileDialog.getExistingDirectory(self)
if dir:
self.save_root = dir
self.lineEdit_toroot.setText(dir)
else:
self.lineEdit_toroot.clear()
def cancel(self):
self.converter.cancel = True
self.close()
def apply(self):
if self.label_root is None or self.save_root is None:
return
self.pushButton_fromroot.setEnabled(False)
self.pushButton_toroot.setEnabled(False)
self.checkBox_keepcrowd.setEnabled(False)
self.pushButton_apply.setEnabled(False)
self.progressBar.reset()
self.textBrowser.clear()
self.converter.cancel = False
self.converter.from_root = self.label_root
self.converter.to_root = self.save_root
self.converter.keep_crowd = self.checkBox_keepcrowd.isChecked()
self.converter.start()
self.pushButton_fromroot.setEnabled(True)
self.pushButton_toroot.setEnabled(True)
self.checkBox_keepcrowd.setEnabled(True)
self.pushButton_apply.setEnabled(True)
def print_message(self, index, all, message):
if all:
self.progressBar.setMaximum(all)
if index:
self.progressBar.setValue(index)
if message:
self.textBrowser.append(message)
def init_connect(self):
self.pushButton_fromroot.clicked.connect(self._label_root)
self.pushButton_toroot.clicked.connect(self._save_root)
self.pushButton_apply.clicked.connect(self.apply)
self.pushButton_cancel.clicked.connect(self.cancel)

View File

@ -14,6 +14,7 @@ from widgets.shortcut_dialog import ShortcutDialog
from widgets.about_dialog import AboutDialog
from widgets.ISAT_to_VOC_dialog import ISATtoVOCDialog
from widgets.ISAT_to_COCO_dialog import ISATtoCOCODialog
from widgets.ISAT_to_LABELME_dialog import ISATtoLabelMeDialog
from widgets.COCO_to_ISAT_dialog import COCOtoISATDialog
from widgets.canvas import AnnotationScene, AnnotationView
from configs import STATUSMode, MAPMode, load_config, save_config, CONFIG_FILE, DEFAULT_CONFIG_FILE
@ -104,6 +105,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
self.ISAT_to_VOC_dialog = ISATtoVOCDialog(self, mainwindow=self)
self.ISAT_to_COCO_dialog = ISATtoCOCODialog(self, mainwindow=self)
self.ISAT_to_LABELME_dialog = ISATtoLabelMeDialog(self, mainwindow=self)
self.COCO_to_ISAT_dialog = COCOtoISATDialog(self, mainwindow=self)
self.view = AnnotationView(parent=self)
@ -155,6 +157,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
self.shortcut_dialog.retranslateUi(self.shortcut_dialog)
self.ISAT_to_VOC_dialog.retranslateUi(self.ISAT_to_VOC_dialog)
self.ISAT_to_COCO_dialog.retranslateUi(self.ISAT_to_COCO_dialog)
self.ISAT_to_LABELME_dialog.retranslateUi(self.ISAT_to_LABELME_dialog)
self.COCO_to_ISAT_dialog.retranslateUi(self.COCO_to_ISAT_dialog)
def translate_to_chinese(self):
@ -477,6 +480,10 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
self.ISAT_to_COCO_dialog.reset_gui()
self.ISAT_to_COCO_dialog.show()
def ISAT_to_LABELME(self):
self.ISAT_to_LABELME_dialog.reset_gui()
self.ISAT_to_LABELME_dialog.show()
def COCO_to_ISAT(self):
self.COCO_to_ISAT_dialog.reset_gui()
self.COCO_to_ISAT_dialog.show()
@ -524,6 +531,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
self.actionToVOC.triggered.connect(self.ISAT_to_VOC)
self.actionToCOCO.triggered.connect(self.ISAT_to_COCO)
self.actionTo_LabelMe.triggered.connect(self.ISAT_to_LABELME)
self.actionFromCOCO.triggered.connect(self.COCO_to_ISAT)
self.actionShortcut.triggered.connect(self.help)