expand facial area tests

This commit is contained in:
Sefik Ilkin Serengil 2024-03-02 20:43:02 +00:00
parent c61cb6faf2
commit 20070a3f97

View File

@ -25,6 +25,7 @@ detector_backends = [
"ssd", "ssd",
"dlib", "dlib",
"mtcnn", "mtcnn",
"fastmtcnn",
# "mediapipe", # crashed in mac # "mediapipe", # crashed in mac
"retinaface", "retinaface",
"yunet", "yunet",
@ -56,18 +57,17 @@ for df in dfs:
logger.info(df) logger.info(df)
expand_areas = [0, 25]
# img_paths = ["dataset/img11.jpg", "dataset/img11_reflection.jpg", "dataset/couple.jpg"] img_paths = ["dataset/img11.jpg", "dataset/img11_reflection.jpg"]
img_paths = ["dataset/img11.jpg"] for expand_area in expand_areas:
for img_path in img_paths: for img_path in img_paths:
# extract faces # extract faces
for detector_backend in detector_backends: for detector_backend in detector_backends:
face_objs = DeepFace.extract_faces( face_objs = DeepFace.extract_faces(
img_path=img_path, img_path=img_path,
detector_backend=detector_backend, detector_backend=detector_backend,
align=True, align=True,
# expand_percentage=10, expand_percentage=expand_area,
# target_size=None,
) )
for face_obj in face_objs: for face_obj in face_objs:
face = face_obj["face"] face = face_obj["face"]