Spaces:
Sleeping
Sleeping
Update modeles/insightface_facialRecognition_livenessVerification.py
Browse files
modeles/insightface_facialRecognition_livenessVerification.py
CHANGED
|
@@ -14,7 +14,7 @@ def get_model():
|
|
| 14 |
model.prepare(ctx_id=0) #pour générer un embedding
|
| 15 |
return model
|
| 16 |
|
| 17 |
-
def verify_face_and_liveness(image_path,
|
| 18 |
model = get_model()
|
| 19 |
|
| 20 |
img = cv2.imread(image_path)
|
|
@@ -39,7 +39,7 @@ def verify_face_and_liveness(image_path, template_path, threshold=0.5):
|
|
| 39 |
is_real = liveness > threshold
|
| 40 |
|
| 41 |
emb = face.embedding
|
| 42 |
-
template =
|
| 43 |
|
| 44 |
print("✅ Embedding extrait :", emb[:5])
|
| 45 |
print("Shape de l'embedding :", emb.shape)
|
|
|
|
| 14 |
model.prepare(ctx_id=0) #pour générer un embedding
|
| 15 |
return model
|
| 16 |
|
| 17 |
+
def verify_face_and_liveness(image_path, template_array, threshold=0.5):
|
| 18 |
model = get_model()
|
| 19 |
|
| 20 |
img = cv2.imread(image_path)
|
|
|
|
| 39 |
is_real = liveness > threshold
|
| 40 |
|
| 41 |
emb = face.embedding
|
| 42 |
+
template = template_array
|
| 43 |
|
| 44 |
print("✅ Embedding extrait :", emb[:5])
|
| 45 |
print("Shape de l'embedding :", emb.shape)
|