需要任意两张同一个人的照片能够准确分辨出是不是同一个人,尽量简化识别过程,不需要知道是谁,也最好不用建立索引文件。
现在这个版本的insughtface很奇怪,不知道为什么自己建立索引的时候需要每个人2张照片以上才能识别成功,不然就会报一个莫名其妙的错误。
首先上项目地址:
https://github.com/littletomatodonkey/insight-face-paddle
https://github.com/littletomatodonkey/insight-face-paddle 按照里面的要求装一些依赖就好了
然后测试一下官方自带的数据:
# 建立索引
insightfacepaddle --build_index ./demo/friends/index.bin --img_dir ./demo/friends/gallery --label ./demo/friends/gallery/label.txt
# 检测人脸
insightfacepaddle --det --input ./demo/friends/query/friends1.jpg --output ./output
# 检测+识别
insightfacepaddle --det --rec --index ./demo/friends/index.bin --input ./demo/friends/query/friends2.jpg --output ./output
如果这个能跑通的话至少说明环境没问题了。
注意项目目录里面有一个 insightface_paddle.py 文件,绝大部分的逻辑都在这个里面,我们的修改也主要在这个里面进行。
首先找到InsightFace类,
在里面加一个函数:
<

本文介绍如何使用InsightFace-Paddle在不建立索引的情况下进行人脸比对。通过理解并修改源代码,实现了仅用一张照片就能进行识别的功能。详细步骤包括安装依赖、测试官方数据、理解并简化索引过程、调用关键函数计算相似度,并提供了阈值调整建议及更高精度模型的替换方法。
最低0.47元/天 解锁文章
2万+

被折叠的 条评论
为什么被折叠?



