Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
klorydryk
FacialRecoTrackingScore
Commits
d12dfa2f
Commit
d12dfa2f
authored
Jan 27, 2020
by
klorydryk
Browse files
Add text for all scores - reduce gradient width
parent
5a94445a
Changes
1
Hide whitespace changes
Inline
Side-by-side
trackmultiplefaces.py
View file @
d12dfa2f
...
...
@@ -34,7 +34,7 @@ GREEN = (0, 255, 0)
suspiciousColors
=
{
0
:(
0
,
0
,
0
),
1
:
GREEN
,
2
:
ORANGE
,
3
:
RED
}
avSusRectWidth
=
6
0
avSusRectWidth
=
2
0
cursorSize
=
(
30
,
30
)
cursor
=
cv2
.
imread
(
'logo.png'
)
# Read the file
...
...
@@ -395,17 +395,24 @@ def put_warning_message(fid, faceTrackers, faceSuspicion, resultImage):
suspicion_level
=
faceSuspicion
[
fid
]
text
=
"Citoyen modele"
color
=
GREEN
if
suspicion_level
>
SUSPICIOUS_THRESHOLD
:
text
=
"ATTENTION! PERSONNE DANGEREUSE!"
cv2
.
putText
(
resultImage
,
text
,
# Name's alignment
(
t_x
+
int
((
t_w
-
len
(
text
)
*
10
)
/
2
+
10
),
int
(
t_y
)
+
20
+
t_h
),
cv2
.
FONT_HERSHEY_SIMPLEX
,
0.5
,
RED
,
1
,
cv2
.
LINE_AA
)
color
=
RED
elif
suspicion_level
>
1
:
text
=
"Comportement a surveiller"
color
=
ORANGE
cv2
.
putText
(
resultImage
,
text
,
# Name's alignment
(
t_x
+
int
((
t_w
-
len
(
text
)
*
10
)
/
2
+
10
),
int
(
t_y
)
+
20
+
t_h
),
cv2
.
FONT_HERSHEY_SIMPLEX
,
0.5
,
color
,
1
,
cv2
.
LINE_AA
)
def
rectangle_around_face
(
fid
,
faceTrackers
,
faceSuspicion
,
draw_person_dangerosity
,
resultImage
):
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment