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
7affb342
Commit
7affb342
authored
Apr 26, 2021
by
klorydryk
Browse files
fix too much self
parent
47080111
Changes
1
Hide whitespace changes
Inline
Side-by-side
trackmultiplefaces.py
View file @
7affb342
...
...
@@ -232,10 +232,7 @@ class facetracker:
add_warning_message
):
#Open the webcame device at camera_number
<<<<<<<
HEAD
print
(
"camera_number: "
,
self
.
camera_number
)
=======
>>>>>>>
efac60a
(
fix
self
)
capture
=
cv2
.
VideoCapture
(
self
.
camera_number
)
FULLSCREEN
=
False
...
...
@@ -414,7 +411,7 @@ class facetracker:
else
:
# Directly add name + pass a charset to which name must belong
# "Person " + str(fid)
self
.
faceNames
[
currentFaceID
]
=
self
.
randomnames
.
rand_name
(
charset
)
faceNames
[
currentFaceID
]
=
randomnames
.
rand_name
(
charset
)
self
.
calculateAverageSuspicious
(
faceSuspicion
)
...
...
@@ -437,7 +434,7 @@ class facetracker:
resultImage
)
# Deal with the two others rectangles
tracked_position
=
self
.
faceTrackers
[
fid
].
get_position
()
tracked_position
=
faceTrackers
[
fid
].
get_position
()
t_x
=
int
(
tracked_position
.
left
())
t_y
=
int
(
tracked_position
.
top
())
...
...
@@ -450,7 +447,7 @@ class facetracker:
if
fid
in
faceNames
.
keys
():
cv2
.
putText
(
resultImage
,
self
.
faceNames
[
fid
]
,
faceNames
[
fid
]
,
# Name's alignment
(
t_x
+
int
((
t_w
-
len
(
faceNames
[
fid
])
*
10
)
/
2
+
10
),
int
(
t_y
)
-
10
),
cv2
.
FONT_HERSHEY_SIMPLEX
,
...
...
@@ -460,7 +457,7 @@ class facetracker:
cv2
.
LINE_AA
)
cv2
.
putText
(
resultImage
,
self
.
faceNames
[
fid
]
,
faceNames
[
fid
]
,
# Name's alignment
(
t_x
+
int
((
t_w
-
len
(
faceNames
[
fid
])
*
10
)
/
2
+
10
),
int
(
t_y
)
-
10
),
cv2
.
FONT_HERSHEY_SIMPLEX
,
...
...
@@ -522,7 +519,7 @@ class facetracker:
t_w
=
int
(
tracked_position
.
width
())
t_h
=
int
(
tracked_position
.
height
())
suspicion_level
=
self
.
faceSuspicion
[
fid
]
suspicion_level
=
faceSuspicion
[
fid
]
text
=
"Citoyen modele"
color
=
GREEN
...
...
@@ -591,7 +588,7 @@ class facetracker:
Draw a rectangle around's people face
If draw_person_dangerosity = True -> Add a color based on suspicionLevel
'''
tracked_position
=
self
.
faceTrackers
[
fid
].
get_position
()
tracked_position
=
faceTrackers
[
fid
].
get_position
()
t_x
=
int
(
tracked_position
.
left
())
t_y
=
int
(
tracked_position
.
top
())
...
...
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