Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
a3023fde
Commit
a3023fde
authored
Feb 22, 2017
by
Adam Geitgey
Committed by
Davis E. King
Feb 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove extra semicolons (#446)
parent
e7330980
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
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]
# face recognition model.
detector
=
dlib
.
get_frontal_face_detector
()
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
()
...
...
@@ -95,7 +95,7 @@ for f in glob.glob(os.path.join(faces_folder_path, "*.jpg")):
shape
=
sp
(
img
,
d
)
# Draw the face landmarks on the screen so we can see what face is currently being processed.
win
.
clear_overlay
()
win
.
add_overlay
(
d
)
;
win
.
add_overlay
(
d
)
win
.
add_overlay
(
shape
)
# 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")):
# distance between them less than 0.6 then they are from the same
# person, otherwise they are from different people. He we just print
# the vector to the screen.
face_descriptor
=
facerec
.
compute_face_descriptor
(
img
,
shape
)
;
print
(
face_descriptor
)
;
face_descriptor
=
facerec
.
compute_face_descriptor
(
img
,
shape
)
print
(
face_descriptor
)
# 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
# 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
...
...
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