在Tensorflow Light中实现ArcFace人脸识别。
arcface的Python项目详细描述
弧面人脸识别
实现ArcFace face recognition algorithm。它包括一个基于ResNet50的预训练模型。在
代码基于peteryuX's实现。没有使用全张量流进行推理,而是使用tf.lite.TFLiteConverter
将模型转换为张量流光模型,从而使推理速度提高了约25%。在
安装
您可以通过pip安装软件包:
pip install arcface
快速入门
以下示例说明了此软件包的易用性:
^{pr2}$您可以向calc_emb
函数提供单个图像或图像数组。此外,您可以将图像提供为(绝对或相对)路径或cv2图像。更清楚地说,有四种可能:
- 单个图像的(绝对或相对)路径:
face_rec.calc_emb("test.jpg")
- 图像数组:
face_rec.calc_emb(["test1.jpg", "test2.png"])
- 单个cv2图像:
face_rec.calc_emb(cv2.imread("test.png"))
- cv2图像数组:
face_rec.calc_emb([cv2.imread("test1.jpg"), cv2.imread("test2.png")])
人脸识别工具以numpy数组的形式返回512-d嵌入的数组。在
Notice! This package does neither perform face detection nor face alignment! It assumes that the images are already pre-processsed!
许可证
根据EUPL授权。在
- 项目
标签: