added face recognition + extraction

This commit is contained in:
2026-09-25 08:31:58 +02:00
parent e1702ea970
commit 27fc43fcbb
9 changed files with 77 additions and 18 deletions
+24
View File
@@ -1,5 +1,29 @@
import cv2
import os
from utils import *
from face_detection import *
from face_recognition import *
# list all files in data/raw
files = list_all_files("./data/raw", ["jpg", "webp"])
# process each files
for file_path in files:
filename = file_path.split("/")[-1].split(".")[0]
# load image
img = cv2.imread(file_path)
if img is None:
print(f"ERROR: Could not read image at {file_path}")
continue
cv2.imshow("image1", img)
# detect faces file
faces = detect_face_in_image(img, scale=1)
# extract faces from file
extract_faces(faces, img, filename)
cv2.destroyAllWindows()