人脸聚类方法Dlib

     Dlib为一个优秀的开源人脸识别库,里面有很多人脸检测、识别方法,其中有一项为人脸聚类方法,利用的算法为chinese_whispers_clustering方法,有兴趣的可以自己去搜索这个算法,这里只讲一下应用。

    接口为dlib.chinese_whispers_clustering(arg1,arg2)

    srg1为list,arg2为阈值,float

    这里有一个大坑,先前直接将人脸特征码列表和阈值输入,总是报错:dlib.chinese_whispers_clustering  unable to cast python instance to c++ type,找了各种办法无法解决,然后按照dlib给的example下载了对应的landmark模型和特征提取模型,最后才发现arg1中的值要为dlib.vector类型才能进来计算,因为算法是用C++实现的,这里要做类型转换。

  总结:如果人脸特征计算是用opencv、openface或者其它的方法,也可以用dlib的chinese_whisper_clustering接口,只要将类型转换一下即可,希望对像我一样入坑的盆友有帮助

       

Abstract—Clustering face images according to their latent identity has two important applications: (i) grouping a collection of face images when no external labels are associated with images, and (ii) indexing for efficient large scale face retrieval. The clustering problem is composed of two key parts: representation and similarity metric for face images, and choice of the partition algorithm. We first propose a representation based on ResNet, which has been shown to perform very well in image classification problems. Given this representation, we design a clustering algorithm, Conditional Pairwise Clustering (ConPaC), which directly estimates the adjacency matrix only based on the similarities between face images. This allows a dynamic selection of number of clusters and retains pairwise similarities between faces. ConPaC formulates the clustering problem as a Conditional Random Field (CRF) model and uses Loopy Belief Propagation to find an approximate solution for maximizing the posterior probability of the adjacency matrix. Experimental results on two benchmark face datasets (LFW and IJB-B) show that ConPaC outperforms well known clustering algorithms such as k-means, spectral clustering and approximate Rank-order. Additionally, our algorithm can naturally incorporate pairwise constraints to work in a semi-supervised way that leads to improved clustering performance. We also propose an k-NN variant of ConPaC, which has a linear time complexity given a k-NN graph, suitable for large datasets. Index Terms—face clustering, face representation, Conditional Random Fields, pairwise constraints, semi-supervised clustering.
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值