diff --git a/deepface/api/src/modules/core/routes.py b/deepface/api/src/modules/core/routes.py index 042f4ad..df34fe6 100644 --- a/deepface/api/src/modules/core/routes.py +++ b/deepface/api/src/modules/core/routes.py @@ -87,6 +87,8 @@ def represent(): detector_backend=input_args.get("detector_backend", "opencv"), enforce_detection=input_args.get("enforce_detection", True), align=input_args.get("align", True), + expand_percentage=input_args.get("expand_percentage", 0), + normalization=input_args.get("normalization", "base"), anti_spoofing=input_args.get("anti_spoofing", False), max_faces=input_args.get("max_faces"), ) @@ -118,8 +120,12 @@ def verify(): model_name=input_args.get("model_name", "VGG-Face"), detector_backend=input_args.get("detector_backend", "opencv"), distance_metric=input_args.get("distance_metric", "cosine"), - align=input_args.get("align", True), enforce_detection=input_args.get("enforce_detection", True), + align=input_args.get("align", True), + expand_percentage=input_args.get("expand_percentage", 0), + normalization=input_args.get("normalization", "base"), + silent=input_args.get("silent", False), + threshold=input_args.get("threshold", None), anti_spoofing=input_args.get("anti_spoofing", False), ) @@ -160,6 +166,8 @@ def analyze(): detector_backend=input_args.get("detector_backend", "opencv"), enforce_detection=input_args.get("enforce_detection", True), align=input_args.get("align", True), + expand_percentage=input_args.get("expand_percentage", 0), + silent=input_args.get("silent", False), anti_spoofing=input_args.get("anti_spoofing", False), ) diff --git a/deepface/api/src/modules/core/service.py b/deepface/api/src/modules/core/service.py index 45fc8c4..76978ce 100644 --- a/deepface/api/src/modules/core/service.py +++ b/deepface/api/src/modules/core/service.py @@ -21,6 +21,8 @@ def represent( detector_backend: str, enforce_detection: bool, align: bool, + expand_percentage: int, + normalization: str, anti_spoofing: bool, max_faces: Optional[int] = None, ): @@ -32,6 +34,8 @@ def represent( detector_backend=detector_backend, enforce_detection=enforce_detection, align=align, + expand_percentage=expand_percentage, + normalization=normalization, anti_spoofing=anti_spoofing, max_faces=max_faces, ) @@ -52,6 +56,10 @@ def verify( distance_metric: str, enforce_detection: bool, align: bool, + expand_percentage: int, + normalization: str, + silent: bool, + threshold: Optional[float], anti_spoofing: bool, ): try: @@ -61,8 +69,12 @@ def verify( model_name=model_name, detector_backend=detector_backend, distance_metric=distance_metric, - align=align, enforce_detection=enforce_detection, + align=align, + expand_percentage=expand_percentage, + normalization=normalization, + silent=silent, + threshold=threshold, anti_spoofing=anti_spoofing, ) return obj @@ -79,6 +91,8 @@ def analyze( detector_backend: str, enforce_detection: bool, align: bool, + expand_percentage: int, + silent: bool, anti_spoofing: bool, ): try: @@ -89,7 +103,8 @@ def analyze( detector_backend=detector_backend, enforce_detection=enforce_detection, align=align, - silent=True, + expand_percentage=expand_percentage, + silent=silent, anti_spoofing=anti_spoofing, ) result["results"] = demographies