什么是储存多个向量以进行面部识别的最佳方法
我想对员工作为工作进行面部认可。我已经有了从相机中获取图像的系统,并且输出面部嵌入(128维向量)。因此,据我所知,我的下一步是将这些嵌入与存储在数据库中的某个地方并找到最距离的嵌入。
问题是我想为此启用机器学习。最初,就像每个教程一样,只有一张员工的照片用于创建参考嵌入。但是,如果一个人要为一个人存储多个嵌入呢?例如,也许这个人带有眼镜,或者略有变化的外观,因此我的系统不再识别它。我希望能够将多个嵌入式与一个或另一个人相关联,为每个员工创建嵌入的集合,我认为这将改善识别系统。如果将来我的系统向我展示有未知的人,我可以告诉它,这种嵌入与特定的人相对应。
是否有任何数据库可以存储(也许是数组)或每个人相关的多个向量?我研究了米尔弗斯(Milvus),菲斯(Faiss),但没有发现任何东西。
我将Python 3.9与OpenCV3,TensorFlow和Keras一起创建嵌入。
I want to make a face recognition for employees as work. I already have system that gets image from cameras and outputs face embeddings (128-dimensional vectors). So my next step, as far as I understand, is to compare these embeddings with the one stored somewhere in database and find one with nearest distance.
The problem is that I want to enable machine learning for this. Initially, on like every tutorial, only one photo of employee is used to create a reference embedding. But what if a want to store multiple embeddings for one person? For example, maybe this person came with glasses, or slightly changed appearance so that my system no longer recognises it. I want to be able to associate multiple embeddings with one person or another, creating a collection of embeddings for each employee, I think this would improve recognition system. And if in future my system will show me that there's unknown person, I could tell it that this embedding corresponds to specific person.
Is there any database that can store (maybe as array) or associate multiple vectors per person? I've looked into Milvus, FAISS, but didn't find anything about that.
I use Python 3.9 with OpenCV3, Tensorflow and Keras for creating embeddings.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
也许您可以为Milvus的一个人存储一个ID
Maybe you can store one id for one person with different vectors in milvus
如果您的嵌入来自一个人的不同维度,例如脸部和语音印刷。然后,将两个向量字段存储在Milvus中是有意义的,一个用于面部向量,一个用于语音纹理向量。
If your embeddings come from different dimensions of a person, such as a face and a voiceprint. Then it makes sense to store two vector fields in milvus, one for the face vector and one for the voiceprint vector.
1-您可以为一个人存储许多嵌入。当您有比较时,您将将其与每个人的许多图像进行比较。然后,找到相似性的平均值,并决定他们是同一个人或不同的人。
2-如果您有许多人的面部图像,那么您会发现每张照片的嵌入式,然后找到平均嵌入。假设您为一个人有10张图像,您可以找到所有10张照片中的128-D嵌入。此后,您会发现每个维度的平均值,最后您将有一个128-D嵌入。
我建议您将嵌入在Spotify Intur,Facebook Faiss,Nmslib或Elasticsearch中。您可以通过基本的Google搜索找到使用这些向量数据库的DeepFace库的实现。
1- you can store many embeddings for a person. when you have a face to compare, then you will compare it to the many images of each person. then, find the average of the similarity and decide they are same person or different.
2- if you have many facial images for a person, then you will find embeddings for each photo then find an average embedding. suppose that you have 10 images for a person, you find 128-d embeddings for all of 10 photos. thereafter, you will find the average of each dimension and finally you will have one 128-d embedding.
i recommend you to store your embeddings in spotify annoy, facebook faiss, nmslib or elasticsearch. you can find implementations of deepface library for python with those vector databases with a basic google search.