| 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())}") |
|
|
| |
| img_path = os.path.join("Face_Recognition", "face_database") |
| |
| 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 |
|
|