avoid duplicate detections and loadings

This commit is contained in:
Sefik Ilkin Serengil 2024-02-24 16:24:15 +00:00
parent 0d18a7c2df
commit 644c6b4013
2 changed files with 6 additions and 6 deletions

View File

@ -19,7 +19,7 @@ from deepface.modules import (
recognition, recognition,
demography, demography,
detection, detection,
realtime, streaming,
) )
from deepface import __version__ from deepface import __version__
@ -409,7 +409,7 @@ def stream(
time_threshold = max(time_threshold, 1) time_threshold = max(time_threshold, 1)
frame_threshold = max(frame_threshold, 1) frame_threshold = max(frame_threshold, 1)
realtime.analysis( streaming.analysis(
db_path=db_path, db_path=db_path,
model_name=model_name, model_name=model_name,
detector_backend=detector_backend, detector_backend=detector_backend,

View File

@ -176,7 +176,7 @@ def analysis(
demographies = DeepFace.analyze( demographies = DeepFace.analyze(
img_path=custom_face, img_path=custom_face,
detector_backend=detector_backend, detector_backend="skip",
enforce_detection=False, enforce_detection=False,
silent=True, silent=True,
) )
@ -411,7 +411,7 @@ def analysis(
img_path=custom_face, img_path=custom_face,
db_path=db_path, db_path=db_path,
model_name=model_name, model_name=model_name,
detector_backend=detector_backend, detector_backend="skip",
distance_metric=distance_metric, distance_metric=distance_metric,
enforce_detection=False, enforce_detection=False,
silent=True, silent=True,
@ -429,7 +429,7 @@ def analysis(
display_img = cv2.imread(label) display_img = cv2.imread(label)
# to use extracted face # to use extracted face
source_objs = DeepFace.extract_faces( source_objs = DeepFace.extract_faces(
img_path=label, img_path=display_img,
target_size=(pivot_img_size, pivot_img_size), target_size=(pivot_img_size, pivot_img_size),
detector_backend=detector_backend, detector_backend=detector_backend,
enforce_detection=False, enforce_detection=False,