feat: add missing api options

This commit is contained in:
Stefan Charsley 2025-02-27 03:44:55 +00:00
parent 63ee3c4e05
commit 984c829139
2 changed files with 26 additions and 3 deletions

View File

@ -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),
)

View File

@ -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