mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Changed graph construction for chinese_whispers() so that each face is always
included in the edge graph. If it isn't then the output labels from chinese_whispers would be missing faces in this degenerate case. So basically this fixes a bug where chinese_whispers(), when called from python, would sometimes return a labels array that doesn't include labels for all the inputs.
This commit is contained in:
parent
dc0245af05
commit
1e877b1917
@ -141,7 +141,7 @@ boost::python::list chinese_whispers_clustering(boost::python::list descriptors,
|
||||
std::vector<unsigned long> labels;
|
||||
for (size_t i = 0; i < num_descriptors; ++i)
|
||||
{
|
||||
for (size_t j = i+1; j < num_descriptors; ++j)
|
||||
for (size_t j = i; j < num_descriptors; ++j)
|
||||
{
|
||||
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]);
|
||||
|
Loading…
Reference in New Issue
Block a user