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
7463ec3a
Commit
7463ec3a
authored
Apr 26, 2021
by
Salamandar
Browse files
Fix and rename list_available_cameras
parent
580f1578
Changes
1
Hide whitespace changes
Inline
Side-by-side
trackmultiplefaces.py
100755 → 100644
View file @
7463ec3a
...
...
@@ -58,15 +58,16 @@ rectangleColorSuspicious = RED
SUSPICIOUS_THRESHOLD
=
2
# Get the number of cameras available
def
count
_cameras
():
max_tested
=
10
for
i
in
range
(
max_tested
):
def
list_available
_cameras
():
cameras
=
[]
for
i
in
range
(
10
):
temp_camera
=
cv2
.
VideoCapture
(
i
)
if
temp_camera
.
isOpened
():
temp_camera
.
release
()
continue
yield
i
cameras
.
append
(
i
)
print
(
"Found cameras:"
,
cameras
)
return
cameras
class
facetracker
:
...
...
@@ -618,8 +619,8 @@ class facetracker:
return
color
if
__name__
==
'__main__'
:
for
value
in
count
_cameras
():
camera
=
facetracker
(
value
)
for
camera_id
in
list_available
_cameras
():
camera
=
facetracker
(
camera_id
)
camera
.
detectAndTrackMultipleFaces
(
# False: Names are directly printed on screen, no new thread
start_thread
=
False
,
...
...
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