I tried adding the following code, but I end up with the error from represent function saying :
TypeError: stat: path should be string, bytes, os.PathLike or integer, not dict
I understand that the first argument to represent function should be image path but I am supplying the output of MTCNN detection, which is metadata. I am unable to figure out how I can enforce it to get multiple embedding when there is more than one face in a given image
from mtcnn import MTCNN
import cv2
#pass1
img = cv2.cvtColor(cv2.imread("all_faces.jpeg"), cv2.COLOR_BGR2RGB)
detector = MTCNN()
faces=detector.detect_faces(img)
#pass2
embeddings = []
for face in faces:
embedding = DeepFace.represent(face, model_name = 'Facenet', enforce_detection = False)
embeddings.append(embedding)