Skip to content

Commit 1f4e379

Browse files
committed
- 添加了处理图片exif旋转标签的功能。
1 parent 0d32d45 commit 1f4e379

File tree

6 files changed

+405
-6
lines changed

6 files changed

+405
-6
lines changed

ISAT/ui/MainWindow.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# -*- coding: utf-8 -*-
22

3-
# Form implementation generated from reading ui file '/media/lg/disk2/PycharmProjects/ISAT_with_segment_anything/ISAT/ui/MainWindow.ui'
3+
# Form implementation generated from reading ui file 'D:\PycharmProjects\ISAT_with_segment_anything\ISAT\ui\MainWindow.ui'
44
#
5-
# Created by: PyQt5 UI code generator 5.15.10
5+
# Created by: PyQt5 UI code generator 5.15.7
66
#
77
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
88
# run again. Do not edit this file unless you know what you are doing.
@@ -32,7 +32,7 @@ def setupUi(self, MainWindow):
3232
MainWindow.setCentralWidget(self.centralwidget)
3333
self.menubar = QtWidgets.QMenuBar(MainWindow)
3434
self.menubar.setEnabled(True)
35-
self.menubar.setGeometry(QtCore.QRect(0, 0, 1600, 29))
35+
self.menubar.setGeometry(QtCore.QRect(0, 0, 1600, 25))
3636
font = QtGui.QFont()
3737
font.setFamily("Times New Roman")
3838
font.setPointSize(12)
@@ -346,6 +346,9 @@ def setupUi(self, MainWindow):
346346
icon39.addPixmap(QtGui.QPixmap(":/icon/icons/云运行_link-cloud.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
347347
self.actionRemote_SAM.setIcon(icon39)
348348
self.actionRemote_SAM.setObjectName("actionRemote_SAM")
349+
self.actionProcess_EXIF_tag = QtWidgets.QAction(MainWindow)
350+
self.actionProcess_EXIF_tag.setIcon(icon1)
351+
self.actionProcess_EXIF_tag.setObjectName("actionProcess_EXIF_tag")
349352
self.menuFile.addAction(self.actionImages_dir)
350353
self.menuFile.addAction(self.actionLabel_dir)
351354
self.menuFile.addSeparator()
@@ -375,6 +378,7 @@ def setupUi(self, MainWindow):
375378
self.menuTools.addAction(self.actionVideo_to_frames)
376379
self.menuTools.addAction(self.actionAuto_segment_with_bounding_box)
377380
self.menuTools.addAction(self.actionAnno_validator)
381+
self.menuTools.addAction(self.actionProcess_EXIF_tag)
378382
self.menuEdit.addAction(self.actionSegment_anything_point)
379383
self.menuEdit.addAction(self.actionSegment_anything_box)
380384
self.menuEdit.addAction(self.actionPolygon)
@@ -582,3 +586,4 @@ def retranslateUi(self, MainWindow):
582586
self.actionWindow_shot.setShortcut(_translate("MainWindow", "Ctrl+P"))
583587
self.actionLanguage.setText(_translate("MainWindow", "Language"))
584588
self.actionRemote_SAM.setText(_translate("MainWindow", "Remote SAM"))
589+
self.actionProcess_EXIF_tag.setText(_translate("MainWindow", "Process EXIF tag"))

ISAT/ui/MainWindow.ui

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<x>0</x>
5858
<y>0</y>
5959
<width>1600</width>
60-
<height>29</height>
60+
<height>25</height>
6161
</rect>
6262
</property>
6363
<property name="font">
@@ -150,6 +150,7 @@
150150
<addaction name="actionVideo_to_frames"/>
151151
<addaction name="actionAuto_segment_with_bounding_box"/>
152152
<addaction name="actionAnno_validator"/>
153+
<addaction name="actionProcess_EXIF_tag"/>
153154
</widget>
154155
<widget class="QMenu" name="menuEdit">
155156
<property name="font">
@@ -985,6 +986,15 @@
985986
<string>Remote SAM</string>
986987
</property>
987988
</action>
989+
<action name="actionProcess_EXIF_tag">
990+
<property name="icon">
991+
<iconset resource="../icons.qrc">
992+
<normaloff>:/icon/icons/照片_pic.svg</normaloff>:/icon/icons/照片_pic.svg</iconset>
993+
</property>
994+
<property name="text">
995+
<string>Process EXIF tag</string>
996+
</property>
997+
</action>
988998
</widget>
989999
<resources>
9901000
<include location="../icons.qrc"/>

ISAT/ui/process_exif_dialog.py

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# Form implementation generated from reading ui file 'D:\PycharmProjects\ISAT_with_segment_anything\ISAT\ui\process_exif_dialog.ui'
4+
#
5+
# Created by: PyQt5 UI code generator 5.15.7
6+
#
7+
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
8+
# run again. Do not edit this file unless you know what you are doing.
9+
10+
11+
from PyQt5 import QtCore, QtGui, QtWidgets
12+
13+
14+
class Ui_Dialog(object):
15+
def setupUi(self, Dialog):
16+
Dialog.setObjectName("Dialog")
17+
Dialog.resize(1280, 720)
18+
font = QtGui.QFont()
19+
font.setFamily("Times New Roman")
20+
font.setPointSize(12)
21+
Dialog.setFont(font)
22+
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
23+
self.verticalLayout.setObjectName("verticalLayout")
24+
self.widget = QtWidgets.QWidget(Dialog)
25+
self.widget.setObjectName("widget")
26+
self.horizontalLayout = QtWidgets.QHBoxLayout(self.widget)
27+
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
28+
self.horizontalLayout.setObjectName("horizontalLayout")
29+
self.lineEdit_image_root = QtWidgets.QLineEdit(self.widget)
30+
self.lineEdit_image_root.setReadOnly(True)
31+
self.lineEdit_image_root.setObjectName("lineEdit_image_root")
32+
self.horizontalLayout.addWidget(self.lineEdit_image_root)
33+
self.pushButton_image_root = QtWidgets.QPushButton(self.widget)
34+
self.pushButton_image_root.setObjectName("pushButton_image_root")
35+
self.horizontalLayout.addWidget(self.pushButton_image_root)
36+
self.verticalLayout.addWidget(self.widget)
37+
self.widget_2 = QtWidgets.QWidget(Dialog)
38+
self.widget_2.setObjectName("widget_2")
39+
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.widget_2)
40+
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
41+
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
42+
self.lineEdit_save_root = QtWidgets.QLineEdit(self.widget_2)
43+
self.lineEdit_save_root.setReadOnly(True)
44+
self.lineEdit_save_root.setObjectName("lineEdit_save_root")
45+
self.horizontalLayout_2.addWidget(self.lineEdit_save_root)
46+
self.pushButton_save_root = QtWidgets.QPushButton(self.widget_2)
47+
self.pushButton_save_root.setObjectName("pushButton_save_root")
48+
self.horizontalLayout_2.addWidget(self.pushButton_save_root)
49+
self.verticalLayout.addWidget(self.widget_2)
50+
self.label = QtWidgets.QLabel(Dialog)
51+
self.label.setStyleSheet("color: rgb(255, 0, 0);")
52+
self.label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
53+
self.label.setObjectName("label")
54+
self.verticalLayout.addWidget(self.label)
55+
self.widget_3 = QtWidgets.QWidget(Dialog)
56+
self.widget_3.setObjectName("widget_3")
57+
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.widget_3)
58+
self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
59+
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
60+
spacerItem = QtWidgets.QSpacerItem(1070, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
61+
self.horizontalLayout_3.addItem(spacerItem)
62+
self.checkBox_apply_exif = QtWidgets.QCheckBox(self.widget_3)
63+
self.checkBox_apply_exif.setObjectName("checkBox_apply_exif")
64+
self.horizontalLayout_3.addWidget(self.checkBox_apply_exif)
65+
self.verticalLayout.addWidget(self.widget_3)
66+
self.textBrowser = QtWidgets.QTextBrowser(Dialog)
67+
font = QtGui.QFont()
68+
font.setFamily("宋体")
69+
font.setPointSize(12)
70+
self.textBrowser.setFont(font)
71+
self.textBrowser.setObjectName("textBrowser")
72+
self.verticalLayout.addWidget(self.textBrowser)
73+
self.progressBar = QtWidgets.QProgressBar(Dialog)
74+
self.progressBar.setProperty("value", 0)
75+
self.progressBar.setObjectName("progressBar")
76+
self.verticalLayout.addWidget(self.progressBar)
77+
self.widget_4 = QtWidgets.QWidget(Dialog)
78+
self.widget_4.setObjectName("widget_4")
79+
self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.widget_4)
80+
self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
81+
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
82+
spacerItem1 = QtWidgets.QSpacerItem(1097, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
83+
self.horizontalLayout_4.addItem(spacerItem1)
84+
self.pushButton_start = QtWidgets.QPushButton(self.widget_4)
85+
self.pushButton_start.setObjectName("pushButton_start")
86+
self.horizontalLayout_4.addWidget(self.pushButton_start)
87+
self.pushButton_close = QtWidgets.QPushButton(self.widget_4)
88+
self.pushButton_close.setObjectName("pushButton_close")
89+
self.horizontalLayout_4.addWidget(self.pushButton_close)
90+
self.verticalLayout.addWidget(self.widget_4)
91+
92+
self.retranslateUi(Dialog)
93+
QtCore.QMetaObject.connectSlotsByName(Dialog)
94+
95+
def retranslateUi(self, Dialog):
96+
_translate = QtCore.QCoreApplication.translate
97+
Dialog.setWindowTitle(_translate("Dialog", "Process EXIF tag"))
98+
self.pushButton_image_root.setText(_translate("Dialog", "image root"))
99+
self.pushButton_save_root.setText(_translate("Dialog", "save root"))
100+
self.label.setText(_translate("Dialog", "Deal with the rotation problem of pictures with EXIF tags."))
101+
self.checkBox_apply_exif.setText(_translate("Dialog", "apply EXIF orientation tag"))
102+
self.pushButton_start.setText(_translate("Dialog", "&Start"))
103+
self.pushButton_close.setText(_translate("Dialog", "&Close"))

ISAT/ui/process_exif_dialog.ui

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>Dialog</class>
4+
<widget class="QDialog" name="Dialog">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>1280</width>
10+
<height>720</height>
11+
</rect>
12+
</property>
13+
<property name="font">
14+
<font>
15+
<family>Times New Roman</family>
16+
<pointsize>12</pointsize>
17+
</font>
18+
</property>
19+
<property name="windowTitle">
20+
<string>Process EXIF tag</string>
21+
</property>
22+
<layout class="QVBoxLayout" name="verticalLayout">
23+
<item>
24+
<widget class="QWidget" name="widget" native="true">
25+
<layout class="QHBoxLayout" name="horizontalLayout">
26+
<property name="leftMargin">
27+
<number>0</number>
28+
</property>
29+
<property name="topMargin">
30+
<number>0</number>
31+
</property>
32+
<property name="rightMargin">
33+
<number>0</number>
34+
</property>
35+
<property name="bottomMargin">
36+
<number>0</number>
37+
</property>
38+
<item>
39+
<widget class="QLineEdit" name="lineEdit_image_root">
40+
<property name="readOnly">
41+
<bool>true</bool>
42+
</property>
43+
</widget>
44+
</item>
45+
<item>
46+
<widget class="QPushButton" name="pushButton_image_root">
47+
<property name="text">
48+
<string>image root</string>
49+
</property>
50+
</widget>
51+
</item>
52+
</layout>
53+
</widget>
54+
</item>
55+
<item>
56+
<widget class="QWidget" name="widget_2" native="true">
57+
<layout class="QHBoxLayout" name="horizontalLayout_2">
58+
<property name="leftMargin">
59+
<number>0</number>
60+
</property>
61+
<property name="topMargin">
62+
<number>0</number>
63+
</property>
64+
<property name="rightMargin">
65+
<number>0</number>
66+
</property>
67+
<property name="bottomMargin">
68+
<number>0</number>
69+
</property>
70+
<item>
71+
<widget class="QLineEdit" name="lineEdit_save_root">
72+
<property name="readOnly">
73+
<bool>true</bool>
74+
</property>
75+
</widget>
76+
</item>
77+
<item>
78+
<widget class="QPushButton" name="pushButton_save_root">
79+
<property name="text">
80+
<string>save root</string>
81+
</property>
82+
</widget>
83+
</item>
84+
</layout>
85+
</widget>
86+
</item>
87+
<item>
88+
<widget class="QLabel" name="label">
89+
<property name="styleSheet">
90+
<string notr="true">color: rgb(255, 0, 0);</string>
91+
</property>
92+
<property name="text">
93+
<string>Deal with the rotation problem of pictures with EXIF tags.</string>
94+
</property>
95+
<property name="alignment">
96+
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
97+
</property>
98+
</widget>
99+
</item>
100+
<item>
101+
<widget class="QWidget" name="widget_3" native="true">
102+
<layout class="QHBoxLayout" name="horizontalLayout_3">
103+
<property name="leftMargin">
104+
<number>0</number>
105+
</property>
106+
<property name="topMargin">
107+
<number>0</number>
108+
</property>
109+
<property name="rightMargin">
110+
<number>0</number>
111+
</property>
112+
<property name="bottomMargin">
113+
<number>0</number>
114+
</property>
115+
<item>
116+
<spacer name="horizontalSpacer">
117+
<property name="orientation">
118+
<enum>Qt::Horizontal</enum>
119+
</property>
120+
<property name="sizeHint" stdset="0">
121+
<size>
122+
<width>1070</width>
123+
<height>20</height>
124+
</size>
125+
</property>
126+
</spacer>
127+
</item>
128+
<item>
129+
<widget class="QCheckBox" name="checkBox_apply_exif">
130+
<property name="text">
131+
<string>apply EXIF orientation tag</string>
132+
</property>
133+
</widget>
134+
</item>
135+
</layout>
136+
</widget>
137+
</item>
138+
<item>
139+
<widget class="QTextBrowser" name="textBrowser">
140+
<property name="font">
141+
<font>
142+
<family>宋体</family>
143+
<pointsize>12</pointsize>
144+
</font>
145+
</property>
146+
</widget>
147+
</item>
148+
<item>
149+
<widget class="QProgressBar" name="progressBar">
150+
<property name="value">
151+
<number>0</number>
152+
</property>
153+
</widget>
154+
</item>
155+
<item>
156+
<widget class="QWidget" name="widget_4" native="true">
157+
<layout class="QHBoxLayout" name="horizontalLayout_4">
158+
<property name="leftMargin">
159+
<number>0</number>
160+
</property>
161+
<property name="topMargin">
162+
<number>0</number>
163+
</property>
164+
<property name="rightMargin">
165+
<number>0</number>
166+
</property>
167+
<property name="bottomMargin">
168+
<number>0</number>
169+
</property>
170+
<item>
171+
<spacer name="horizontalSpacer_2">
172+
<property name="orientation">
173+
<enum>Qt::Horizontal</enum>
174+
</property>
175+
<property name="sizeHint" stdset="0">
176+
<size>
177+
<width>1097</width>
178+
<height>20</height>
179+
</size>
180+
</property>
181+
</spacer>
182+
</item>
183+
<item>
184+
<widget class="QPushButton" name="pushButton_start">
185+
<property name="text">
186+
<string>&amp;Start</string>
187+
</property>
188+
</widget>
189+
</item>
190+
<item>
191+
<widget class="QPushButton" name="pushButton_close">
192+
<property name="text">
193+
<string>&amp;Close</string>
194+
</property>
195+
</widget>
196+
</item>
197+
</layout>
198+
</widget>
199+
</item>
200+
</layout>
201+
</widget>
202+
<resources/>
203+
<connections/>
204+
</ui>

0 commit comments

Comments
 (0)