github-actions
Deploy to Hugging Face
c794b6b
Raw
History Blame Contribute Delete
683 Bytes
import cv2
import numpy as np
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "Face_Recognition"))
from face_matcher import FaceMatcher
fe = FaceMatcher()
fe.reload_db()
print(f"DB keys: {list(fe.db.keys())}")
# Try to find a face image
img_path = os.path.join("Face_Recognition", "face_database")
# find first jpg
for root, dirs, files in os.walk(img_path):
for f in files:
if f.endswith(".jpg"):
path = os.path.join(root, f)
print(f"Testing with {path}")
frame = cv2.imread(path)
res = fe.match_frame(frame)
print(res)
break
else:
continue
break