MCPcopy
hub / github.com/serengil/deepface / verify

Function verify

deepface/api/src/modules/core/service.py:47–73  ·  view source on GitHub ↗
(
    img1_path: Union[str, NDArray[Any]],
    img2_path: Union[str, NDArray[Any]],
    model_name: str,
    detector_backend: str,
    distance_metric: str,
    enforce_detection: bool,
    align: bool,
    anti_spoofing: bool,
)

Source from the content-addressed store, hash-verified

45
46
47def verify(
48 img1_path: Union[str, NDArray[Any]],
49 img2_path: Union[str, NDArray[Any]],
50 model_name: str,
51 detector_backend: str,
52 distance_metric: str,
53 enforce_detection: bool,
54 align: bool,
55 anti_spoofing: bool,
56) -> Tuple[Dict[str, Any], int]:
57 try:
58 obj = DeepFace.verify(
59 img1_path=img1_path,
60 img2_path=img2_path,
61 model_name=model_name,
62 detector_backend=detector_backend,
63 distance_metric=distance_metric,
64 align=align,
65 enforce_detection=enforce_detection,
66 anti_spoofing=anti_spoofing,
67 )
68 return obj, 200
69 except Exception as err:
70 tb_str = traceback.format_exc()
71 logger.error(str(err))
72 logger.error(tb_str)
73 return {"error": f"Exception while verifying: {str(err)} - {tb_str}"}, 400
74
75
76def analyze(

Callers

nothing calls this directly

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected