我正在为人脸识别项目使用深度人脸库。就我而言,我想使用 facenet 检测测试图像中存在的多个人脸。当我应用 deepface 预处理函数时,我看到它只生成一个嵌入,在给定的图像中存在四个面。我怎样才能得到每张脸各自的嵌入?
**my code looks:**
import deepface as DeepFace
from elasticsearch import Elasticsearch
from deepface.basemodels import Facenet
import os
from deepface.commons import functions
model = Facenet.loadModel()
target_size = (160, 160)
embedding_size = 128
backends = ['opencv', 'ssd', 'dlib', 'mtcnn', 'retinaface']
target_path = "/home/niveus/PycharmProjects/deepface-elastic-research/deepface/align_img/deep_aku.jpg"
target_img = functions.preprocess_face(target_path, target_size = target_size,detector_backend = backends[3])
target_embedding = model.predict(target_img)[0] #[0]
print(target_embedding.shape)
print("embeddings",target_embedding)