Skip to content

Commit

Permalink
Merge pull request #13 from cvjena/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Timozen authored Apr 19, 2024
2 parents 6a68d86 + feba090 commit d1c2513
Show file tree
Hide file tree
Showing 22 changed files with 2,810 additions and 173 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ temp/
venv*
*.dmg
*.spec
!examples/ear_score.csv
!examples/*.csv
!examples/*.mp4

paper/paper.jats
paper/paper.pdf
Expand Down
File renamed without changes.
251 changes: 251 additions & 0 deletions examples/ear_score_30.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
frame,EAR2D6_l,EAR2D6_r,EAR2D6_valid,BS_Valid
0, 0.30839515, 0.31717056,True,True
1, 0.30697849, 0.31643425,True,True
2, 0.31780323, 0.32533049,True,True
3, 0.31657635, 0.31336477,True,True
4, 0.31764210, 0.31694362,True,True
5, 0.31386926, 0.31409277,True,True
6, 0.31484655, 0.31612779,True,True
7, 0.30915708, 0.31312242,True,True
8, 0.30693714, 0.31124881,True,True
9, 0.30799023, 0.31312242,True,True
10, 0.30571419, 0.30799125,True,True
11, 0.30042486, 0.30502849,True,True
12, 0.28607607, 0.30721214,True,True
13, 0.30121833, 0.30183604,True,True
14, 0.29187137, 0.30210629,True,True
15, 0.29767902, 0.29821654,True,True
16, 0.29061937, 0.30378166,True,True
17, 0.29875644, 0.29564100,True,True
18, 0.29875644, 0.30551011,True,True
19, 0.30571419, 0.29564100,True,True
20, 0.29262141, 0.29620622,True,True
21, 0.29262141, 0.29330723,True,True
22, 0.27219442, 0.27695657,True,True
23, 0.01769842, 0.01282979,True,True
24, 0.01231288, 0.02070684,True,True
25, 0.02101940, 0.01370297,True,True
26, 0.04426898, 0.02246624,True,True
27, 0.03302003, 0.00803064,True,True
28, 0.07497124, 0.02872804,True,True
29, 0.19807905, 0.19991081,True,True
30, 0.23124061, 0.24272208,True,True
31, 0.25739383, 0.26800041,True,True
32, 0.26600419, 0.27675620,True,True
33, 0.26620216, 0.28076742,True,True
34, 0.27219442, 0.28631641,True,True
35, 0.27817795, 0.28247069,True,True
36, 0.27817795, 0.28490235,True,True
37, 0.27819434, 0.28490235,True,True
38, 0.28417787, 0.29053216,True,True
39, 0.28076650, 0.29130211,True,True
40, 0.29126256, 0.29442629,True,True
41, 0.29036380, 0.29442629,True,True
42, 0.28054342, 0.28490235,True,True
43, 0.28688787, 0.29672592,True,True
44, 0.28076650, 0.29109611,True,True
45, 0.28670108, 0.28816167,True,True
46, 0.28076650, 0.28816167,True,True
47, 0.28417787, 0.29109611,True,True
48, 0.28784117, 0.29340709,True,True
49, 0.28790582, 0.29821654,True,True
50, 0.28435252, 0.29672592,True,True
51, 0.28076650, 0.29055364,True,True
52, 0.06502978, 0.03658265,True,True
53, 0.02024917, 0.02625834,True,True
54, 0.02000166, 0.01876873,True,True
55, 0.00874105, 0.02432521,True,True
56, 0.01492190, 0.02768382,True,True
57, 0.00863546, 0.02092892,True,True
58, 0.01492190, 0.03351722,True,True
59, 0.01236170, 0.01641662,True,True
60, 0.01233816, 0.01856745,True,True
61, 0.01831858, 0.00802237,True,True
62, 0.04230399, 0.00000000,True,True
63, 0.06181197, 0.02005528,True,True
64, 0.20705129, 0.22071539,True,True
65, 0.24511024, 0.24825420,True,True
66, 0.26281608, 0.27651996,True,True
67, 0.27138363, 0.28679968,True,True
68, 0.27138363, 0.29316770,True,True
69, 0.29029085, 0.30401200,True,True
70, 0.29152860, 0.30015060,True,True
71, 0.29287058, 0.30957440,True,True
72, 0.27435362, 0.29465200,True,True
73, 0.27774988, 0.29391477,True,True
74, 0.29281205, 0.29593631,True,True
75, 0.28205807, 0.30210629,True,True
76, 0.28360660, 0.29316770,True,True
77, 0.28491334, 0.30566975,True,True
78, 0.29736310, 0.29793630,True,True
79, 0.28449054, 0.30401200,True,True
80, 0.28346620, 0.30158417,True,True
81, 0.28915019, 0.29647832,True,True
82, 0.28346620, 0.28974773,True,True
83, 0.29029085, 0.29873282,True,True
84, 0.29520791, 0.29873282,True,True
85, 0.29047551, 0.30129435,True,True
86, 0.28481250, 0.29235676,True,True
87, 0.29038721, 0.30075286,True,True
88, 0.29399576, 0.29478969,True,True
89, 0.28474855, 0.29793630,True,True
90, 0.29544620, 0.29760003,True,True
91, 0.29047551, 0.29761966,True,True
92, 0.29734401, 0.30129435,True,True
93, 0.30882459, 0.30856107,True,True
94, 0.30317851, 0.30566975,True,True
95, 0.29734401, 0.30210629,True,True
96, 0.29985247, 0.30129435,True,True
97, 0.29991155, 0.30691690,True,True
98, 0.29411627, 0.30639529,True,True
99, 0.29736310, 0.30210629,True,True
100, 0.30554130, 0.32070147,True,True
101, 0.30754054, 0.31882648,True,True
102, 0.31910433, 0.32414189,True,True
103, 0.28094941, 0.27651996,True,True
104, 0.01744879, 0.02406710,True,True
105, 0.02247274, 0.03177595,True,True
106, 0.00860217, 0.03313757,True,True
107, 0.03164379, 0.01356214,True,True
108, 0.06768018, 0.01817901,True,True
109, 0.20271529, 0.22393133,True,True
110, 0.24316228, 0.25774618,True,True
111, 0.26001681, 0.28631641,True,True
112, 0.28056569, 0.28220608,True,True
113, 0.28056569, 0.29362676,True,True
114, 0.27485479, 0.29931613,True,True
115, 0.28094941, 0.29305686,True,True
116, 0.26910210, 0.28466462,True,True
117, 0.27036253, 0.28789544,True,True
118, 0.27151763, 0.27901948,True,True
119, 0.27870788, 0.29593631,True,True
120, 0.28456170, 0.29593631,True,True
121, 0.28913736, 0.29388577,True,True
122, 0.28790582, 0.30129435,True,True
123, 0.29387780, 0.30158417,True,True
124, 0.29047551, 0.30639529,True,True
125, 0.29152860, 0.30639529,True,True
126, 0.29387249, 0.30034817,True,True
127, 0.29174260, 0.30349620,True,True
128, 0.29174260, 0.30202917,True,True
129, 0.29274450, 0.30152513,True,True
130, 0.29876218, 0.30924539,True,True
131, 0.28607607, 0.30349620,True,True
132, 0.28933412, 0.30017115,True,True
133, 0.29876218, 0.31084737,True,True
134, 0.28156328, 0.30535200,True,True
135, 0.29876218, 0.31084737,True,True
136, 0.30084331, 0.30034817,True,True
137, 0.28824583, 0.30265839,True,True
138, 0.28947251, 0.29738223,True,True
139, 0.28476367, 0.29465200,True,True
140, 0.29399576, 0.30616180,True,True
141, 0.28122135, 0.29793630,True,True
142, 0.08696232, 0.07316529,True,True
143, 0.00872440, 0.02460670,True,True
144, 0.01941004, 0.02893588,True,True
145, 0.02526354, 0.03793540,True,True
146, 0.02328699, 0.04282244,True,True
147, 0.01221239, 0.01796818,True,True
148, 0.03546387, 0.00549417,True,True
149, 0.11005832, 0.05299722,True,True
150, 0.22507869, 0.22884677,True,True
151, 0.24808096, 0.25126705,True,True
152, 0.26451688, 0.28204309,True,True
153, 0.26857695, 0.28416769,True,True
154, 0.27301256, 0.28416769,True,True
155, 0.27997872, 0.28442911,True,True
156, 0.28101880, 0.28939994,True,True
157, 0.27989908, 0.28838177,True,True
158, 0.27870788, 0.29340709,True,True
159, 0.29038721, 0.29316770,True,True
160, 0.27761239, 0.28227340,True,True
161, 0.26704718, 0.28760540,True,True
162, 0.26704718, 0.28281947,True,True
163, 0.26590579, 0.28760540,True,True
164, 0.28326359, 0.28204309,True,True
165, 0.27880359, 0.27729200,True,True
166, 0.27286259, 0.28416769,True,True
167, 0.26590579, 0.28416769,True,True
168, 0.28248591, 0.28733513,True,True
169, 0.27448633, 0.27867187,True,True
170, 0.27566412, 0.28389907,True,True
171, 0.27556948, 0.28442911,True,True
172, 0.27870788, 0.28389907,True,True
173, 0.27884592, 0.28416769,True,True
174, 0.26715126, 0.28913396,True,True
175, 0.27424381, 0.29465200,True,True
176, 0.26278444, 0.28389907,True,True
177, 0.27884592, 0.28122140,True,True
178, 0.26965958, 0.28706944,True,True
179, 0.27884592, 0.29031120,True,True
180, 0.27556948, 0.28706944,True,True
181, 0.28467151, 0.28132200,True,True
182, 0.27435362, 0.28939994,True,True
183, 0.25727224, 0.26536923,True,True
184, 0.02088370, 0.01338259,True,True
185, 0.01360123, 0.01368535,True,True
186, 0.01218968, 0.02069220,True,True
187, 0.01489348, 0.02813706,True,True
188, 0.01208685, 0.01339907,True,True
189, 0.06587889, 0.02260906,True,True
190, 0.07325627, 0.03493840,True,True
191, 0.21407690, 0.22462453,True,True
192, 0.24230951, 0.24911082,True,True
193, 0.26417941, 0.27670971,True,True
194, 0.26573676, 0.27592677,True,True
195, 0.27774988, 0.29235676,True,True
196, 0.27448633, 0.28363814,True,True
197, 0.26603749, 0.28363814,True,True
198, 0.27894167, 0.28387229,True,True
199, 0.27190170, 0.28493478,True,True
200, 0.27448633, 0.28733513,True,True
201, 0.27774988, 0.28883339,True,True
202, 0.28933412, 0.29235676,True,True
203, 0.28607607, 0.28915618,True,True
204, 0.28593776, 0.29492306,True,True
205, 0.28028817, 0.28966629,True,True
206, 0.27566412, 0.28957076,True,True
207, 0.27661347, 0.29143903,True,True
208, 0.26603749, 0.28915618,True,True
209, 0.27904043, 0.28913396,True,True
210, 0.28499447, 0.29465200,True,True
211, 0.27566412, 0.29813491,True,True
212, 0.27674727, 0.29465200,True,True
213, 0.27566412, 0.28363814,True,True
214, 0.28607607, 0.29465200,True,True
215, 0.27129853, 0.29194358,True,True
216, 0.28810647, 0.29543364,True,True
217, 0.28476367, 0.28671125,True,True
218, 0.28132988, 0.29170131,True,True
219, 0.28217403, 0.29220632,True,True
220, 0.28364877, 0.30042672,True,True
221, 0.28476367, 0.30304016,True,True
222, 0.28378281, 0.29687768,True,True
223, 0.28396498, 0.30566975,True,True
224, 0.28387867, 0.30017115,True,True
225, 0.29422187, 0.30233665,True,True
226, 0.28378281, 0.30233665,True,True
227, 0.28607607, 0.30616180,True,True
228, 0.07306278, 0.04001991,True,True
229, 0.01190308, 0.02002629,True,True
230, 0.01767767, 0.01979643,True,True
231, 0.02384842, 0.01097841,True,True
232, 0.03500224, 0.01201562,True,True
233, 0.14034599, 0.10153823,True,True
234, 0.20675459, 0.22546911,True,True
235, 0.24530257, 0.25126705,True,True
236, 0.24239267, 0.26500531,True,True
237, 0.26391243, 0.27287946,True,True
238, 0.25075540, 0.28025274,True,True
239, 0.27674727, 0.28389907,True,True
240, 0.26921031, 0.29143903,True,True
241, 0.27909436, 0.29714485,True,True
242, 0.27323818, 0.28154177,True,True
243, 0.27372611, 0.28974508,True,True
244, 0.26667730, 0.28667322,True,True
245, 0.27129853, 0.28688769,True,True
246, 0.26921031, 0.28736231,True,True
247, 0.27690214, 0.28432221,True,True
248, 0.27806570, 0.28974508,True,True
249, 0.26818388, 0.28227222,True,True
Binary file added examples/test_long.mp4
Binary file not shown.
Binary file added examples/test_short.mp4
Binary file not shown.
96 changes: 95 additions & 1 deletion frontend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import structlog

from PyQt6 import QtGui
from PyQt6.QtWidgets import QMainWindow, QTabWidget, QProgressBar, QWidget
from PyQt6.QtWidgets import QMainWindow, QTabWidget, QProgressBar, QWidget, QMessageBox

from frontend import config
from .ui_facial_feature_extraction import FacialFeatureExtraction
Expand All @@ -18,6 +18,29 @@
def add_space_between_words(text):
return re.sub(r"(\w)([A-Z])", r"\1 \2", text)

LICENCE_TEXT = """
JeFaPaTo is licensed under the MIT License.
MIT License
Copyright (c) [2023] [Tim Büchner]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

class JeFaPaTo(QMainWindow, config.Config):
def __init__(self, args: argparse.Namespace) -> None:
"""
Expand Down Expand Up @@ -61,6 +84,16 @@ def __init__(self, args: argparse.Namespace) -> None:

self.statusBar().addPermanentWidget(self.progress_bar)

# Create menu bar
menu_bar = self.menuBar()
# Create Help menu
help_menu = menu_bar.addMenu("Help")

help_menu.addAction("About", self.show_about)
help_menu.addAction("Documentation", self.show_documentation)
help_menu.addAction("License", self.show_license)
help_menu.addAction("Acknowledgements", self.show_acknowledgements)

def closeEvent(self, event: QtGui.QCloseEvent) -> None:
"""
Event handler for the close event of the application window.
Expand All @@ -81,3 +114,64 @@ def closeEvent(self, event: QtGui.QCloseEvent) -> None:
self.save()
logger.info("Internal Shut Down complete", widget=self)
super().closeEvent(event)

def show_about(self):
"""
Shows the About dialog.
"""
## use a dialog to show the about information
dialog = QMessageBox()
dialog.setWindowTitle("About JeFaPaTo")
dialog.setText("JeFaPaTo - Jena Facial Palsy Tool")
dialog.setInformativeText("""
<ul>
<li> Version: 1.0.0 </li>
<li> Author: Tim Büchner </li>
<li> License: MIT </li>
<li> Link: <a href="https://github.com/cvjena/JeFaPaTo">Website</a> </li>
</ul>
""")
dialog.setStandardButtons(QMessageBox.StandardButton.Ok)
dialog.exec()

def show_documentation(self):
"""
Shows the Documentation dialog.
"""
dialog = QMessageBox()
dialog.setWindowTitle("Documentation")
dialog.setText("Documentation")
dialog.setInformativeText("""
Documentation is available at <a href="https://github.com/cvjena/JeFaPaTo/wiki"> our wiki page</a>.
"""
)
dialog.setStandardButtons(QMessageBox.StandardButton.Ok)
dialog.exec()

def show_license(self):
"""
Shows the License dialog.
"""
dialog = QMessageBox()
dialog.setWindowTitle("License")
dialog.setText("License")
dialog.setInformativeText(LICENCE_TEXT)
dialog.setStandardButtons(QMessageBox.StandardButton.Ok)
dialog.exec()

def show_acknowledgements(self):
"""
Shows the Acknowledgements dialog.
"""

dialog = QMessageBox()
dialog.setWindowTitle("Acknowledgements")
dialog.setText("Acknowledgements")
dialog.setInformativeText("""
JeFaPaTo is based on the <a href="https://github.com/google/mediapipe"> MediaPipe library </a> by Google.
We would like to thank the developers for their great work and the possibility to use their library.
Additionally, we would like to thank the <a href="https://opencv.org/"> OpenCV </a> team for their great work and the possibility to use their library.
Also, we thank our medical partners for their support and feedback.
""")
dialog.setStandardButtons(QMessageBox.StandardButton.Ok)
dialog.exec()
Loading

0 comments on commit d1c2513

Please sign in to comment.