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
93a1aba0
Commit
93a1aba0
authored
Sep 09, 2017
by
Varun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added threshold to clustering call
parent
8b48c09c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
face_clustering.py
python_examples/face_clustering.py
+1
-1
face_recognition.cpp
tools/python/src/face_recognition.cpp
+3
-3
No files found.
python_examples/face_clustering.py
View file @
93a1aba0
...
...
@@ -100,7 +100,7 @@ for f in glob.glob(os.path.join(faces_folder_path, "*.jpg")):
# middle value, such as 10, which is only 10x slower but still gets an
# LFW accuracy of 99.3%.
labels
=
facerec
.
cluster
(
descriptors
)
labels
=
facerec
.
cluster
(
descriptors
,
0.5
)
label_classes
=
list
(
set
(
labels
))
label_classes
.
sort
()
num_classes
=
len
(
label_classes
)
...
...
tools/python/src/face_recognition.cpp
View file @
93a1aba0
...
...
@@ -39,7 +39,7 @@ public:
cropper
->
set_max_rotation_degrees
(
3
);
}
boost
::
python
::
list
cluster
(
boost
::
python
::
list
descriptors
)
boost
::
python
::
list
cluster
(
boost
::
python
::
list
descriptors
,
float
threshold
)
{
boost
::
python
::
list
clusters
;
...
...
@@ -61,7 +61,7 @@ public:
matrix
<
double
,
0
,
1
>
first_descriptor
=
boost
::
python
::
extract
<
matrix
<
double
,
0
,
1
>>
(
descriptors
[
i
]);
matrix
<
double
,
0
,
1
>
second_descriptor
=
boost
::
python
::
extract
<
matrix
<
double
,
0
,
1
>>
(
descriptors
[
j
]);
if
(
length
(
first_descriptor
-
second_descriptor
)
<
0.6
)
if
(
length
(
first_descriptor
-
second_descriptor
)
<
threshold
)
edges
.
push_back
(
sample_pair
(
i
,
j
));
}
}
...
...
@@ -237,7 +237,7 @@ void bind_face_recognition()
.
def
(
"save_image_chips"
,
&
face_recognition_model_v1
::
save_image_chips
,
(
arg
(
"img"
),
arg
(
"faces"
),
arg
(
"chip_filename"
)),
"Takes an image and a full_object_detections object that reference faces in that image and saves the faces with the specified file name prefix"
)
.
def
(
"cluster"
,
&
face_recognition_model_v1
::
cluster
,
(
arg
(
"descriptors"
)),
.
def
(
"cluster"
,
&
face_recognition_model_v1
::
cluster
,
(
arg
(
"descriptors"
)
,
arg
(
"threshold"
)
),
"Takes a list of descriptors and returns a list that contains a label for each descriptor. Clustering is done using chinese_whispers."
);
}
...
...
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