Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mood Meter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KI-gestütztes Marketing
Backend Development
Mood Meter
Commits
166ff2a7
Commit
166ff2a7
authored
1 year ago
by
Amel Abdic
Browse files
Options
Downloads
Patches
Plain Diff
Implemented Subtitles
parent
42135c4a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.py
+7
-1
7 additions, 1 deletion
main.py
with
7 additions
and
1 deletion
main.py
+
7
−
1
View file @
166ff2a7
import
os
import
os
import
textwrap
from
turtle
import
position
from
turtle
import
position
import
warnings
import
warnings
...
@@ -109,6 +110,7 @@ class Main:
...
@@ -109,6 +110,7 @@ class Main:
self
.
flag
=
False
self
.
flag
=
False
self
.
selection
=
3
self
.
selection
=
3
self
.
it
=
0
self
.
it
=
0
self
.
text
=
None
...
@@ -163,6 +165,7 @@ class Main:
...
@@ -163,6 +165,7 @@ class Main:
generated_text
=
result
[
'
openai
'
][
'
generated_text
'
]
generated_text
=
result
[
'
openai
'
][
'
generated_text
'
]
print
(
generated_text
)
print
(
generated_text
)
self
.
speak_in_thread
(
generated_text
)
self
.
speak_in_thread
(
generated_text
)
self
.
text
=
generated_text
except
Exception
as
e
:
except
Exception
as
e
:
print
(
f
"
Fehler beim Senden/Empfangen der Daten zu/von ChatGPT:
{
e
}
"
)
print
(
f
"
Fehler beim Senden/Empfangen der Daten zu/von ChatGPT:
{
e
}
"
)
...
@@ -216,7 +219,10 @@ class Main:
...
@@ -216,7 +219,10 @@ class Main:
cv2
.
putText
(
frame
,
f
'
Approx. Age:
{
analyze
.
get
(
"
age
"
,
"
N/A
"
)
}
'
,
(
x
,
y
-
10
),
cv2
.
FONT_HERSHEY_SIMPLEX
,
0.9
,
(
0
,
0
,
255
),
2
)
cv2
.
putText
(
frame
,
f
'
Approx. Age:
{
analyze
.
get
(
"
age
"
,
"
N/A
"
)
}
'
,
(
x
,
y
-
10
),
cv2
.
FONT_HERSHEY_SIMPLEX
,
0.9
,
(
0
,
0
,
255
),
2
)
cv2
.
putText
(
frame
,
f
'
Approx. Gender:
{
analyze
.
get
(
"
dominant_gender
"
,
"
N/A
"
)
}
'
,
(
x
,
y
-
40
),
cv2
.
FONT_HERSHEY_SIMPLEX
,
0.9
,
(
0
,
255
,
255
),
2
)
cv2
.
putText
(
frame
,
f
'
Approx. Gender:
{
analyze
.
get
(
"
dominant_gender
"
,
"
N/A
"
)
}
'
,
(
x
,
y
-
40
),
cv2
.
FONT_HERSHEY_SIMPLEX
,
0.9
,
(
0
,
255
,
255
),
2
)
cv2
.
putText
(
frame
,
f
'
Current emotion:
{
analyze
.
get
(
"
dominant_emotion
"
,
"
N/A
"
)
}
'
,
(
x
,
y
-
70
),
cv2
.
FONT_HERSHEY_SIMPLEX
,
0.9
,
(
255
,
255
,
0
),
2
)
cv2
.
putText
(
frame
,
f
'
Current emotion:
{
analyze
.
get
(
"
dominant_emotion
"
,
"
N/A
"
)
}
'
,
(
x
,
y
-
70
),
cv2
.
FONT_HERSHEY_SIMPLEX
,
0.9
,
(
255
,
255
,
0
),
2
)
if
self
.
text
!=
None
:
new_text
=
textwrap
.
fill
(
self
.
text
,
width
=
35
)
for
i
,
line
in
enumerate
(
new_text
.
split
(
'
\n
'
)):
cv2
.
putText
(
frame
,
line
,
(
50
,
900
+
i
*
30
),
cv2
.
FONT_HERSHEY_SIMPLEX
,
0.9
,
(
255
,
255
,
255
),
2
)
emotion
=
analyze
.
get
(
"
dominant_emotion
"
,
"
N/A
"
)
emotion
=
analyze
.
get
(
"
dominant_emotion
"
,
"
N/A
"
)
if
emotion
in
emoji_images
:
if
emotion
in
emoji_images
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment