Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
a3023fde
"docs/git@developer.sourcefind.cn:OpenDAS/deepspeed.git" did not exist on "00183ed58d2344255622bffdee473836e0f80e16"
Commit
a3023fde
authored
Feb 22, 2017
by
Adam Geitgey
Committed by
Davis E. King
Feb 22, 2017
Browse files
Remove extra semicolons (#446)
parent
e7330980
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
python_examples/face_recognition.py
python_examples/face_recognition.py
+5
-5
No files found.
python_examples/face_recognition.py
View file @
a3023fde
...
@@ -69,7 +69,7 @@ faces_folder_path = sys.argv[3]
...
@@ -69,7 +69,7 @@ faces_folder_path = sys.argv[3]
# face recognition model.
# face recognition model.
detector
=
dlib
.
get_frontal_face_detector
()
detector
=
dlib
.
get_frontal_face_detector
()
sp
=
dlib
.
shape_predictor
(
predictor_path
)
sp
=
dlib
.
shape_predictor
(
predictor_path
)
facerec
=
dlib
.
face_recognition_model_v1
(
face_rec_model_path
)
;
facerec
=
dlib
.
face_recognition_model_v1
(
face_rec_model_path
)
win
=
dlib
.
image_window
()
win
=
dlib
.
image_window
()
...
@@ -95,7 +95,7 @@ for f in glob.glob(os.path.join(faces_folder_path, "*.jpg")):
...
@@ -95,7 +95,7 @@ for f in glob.glob(os.path.join(faces_folder_path, "*.jpg")):
shape
=
sp
(
img
,
d
)
shape
=
sp
(
img
,
d
)
# Draw the face landmarks on the screen so we can see what face is currently being processed.
# Draw the face landmarks on the screen so we can see what face is currently being processed.
win
.
clear_overlay
()
win
.
clear_overlay
()
win
.
add_overlay
(
d
)
;
win
.
add_overlay
(
d
)
win
.
add_overlay
(
shape
)
win
.
add_overlay
(
shape
)
# Compute the 128D vector that describes the face in img identified by
# Compute the 128D vector that describes the face in img identified by
...
@@ -103,10 +103,10 @@ for f in glob.glob(os.path.join(faces_folder_path, "*.jpg")):
...
@@ -103,10 +103,10 @@ for f in glob.glob(os.path.join(faces_folder_path, "*.jpg")):
# distance between them less than 0.6 then they are from the same
# distance between them less than 0.6 then they are from the same
# person, otherwise they are from different people. He we just print
# person, otherwise they are from different people. He we just print
# the vector to the screen.
# the vector to the screen.
face_descriptor
=
facerec
.
compute_face_descriptor
(
img
,
shape
)
;
face_descriptor
=
facerec
.
compute_face_descriptor
(
img
,
shape
)
print
(
face_descriptor
)
;
print
(
face_descriptor
)
# It should also be noted that you can also call this function like this:
# It should also be noted that you can also call this function like this:
# face_descriptor = facerec.compute_face_descriptor(img, shape, 100)
;
# face_descriptor = facerec.compute_face_descriptor(img, shape, 100)
# The version of the call without the 100 gets 99.13% accuracy on LFW
# The version of the call without the 100 gets 99.13% accuracy on LFW
# while the version with 100 gets 99.38%. However, the 100 makes the
# while the version with 100 gets 99.38%. However, the 100 makes the
# call 100x slower to execute, so choose whatever version you like. To
# call 100x slower to execute, so choose whatever version you like. To
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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