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

Function test_find_with_exact_path

tests/unit/test_find.py:20–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18
19
20def test_find_with_exact_path():
21 img_path = os.path.join("dataset", "img1.jpg")
22 dfs = DeepFace.find(img_path=img_path, db_path="dataset", silent=True)
23 assert len(dfs) > 0
24 for df in dfs:
25 assert isinstance(df, pd.DataFrame)
26
27 # one is img1.jpg itself
28 identity_df = df[df["identity"] == img_path]
29 assert identity_df.shape[0] > 0
30
31 # validate reproducability
32 assert identity_df["distance"].values[0] <= threshold
33
34 df = df[df["identity"] != img_path]
35 logger.debug(df.head())
36 assert df.shape[0] > 0
37
38 assert "confidence" in df.columns
39 # confidence is between 0 and 100
40 assert df["confidence"].max() <= 100
41 assert df["confidence"].min() >= 0
42 # also we just show verified ones in results
43 assert df["confidence"].max() <= 100
44 assert df["confidence"].min() >= 51
45
46 logger.info("✅ test find for exact path done")
47
48
49def test_find_with_array_input():

Callers

nothing calls this directly

Calls 2

debugMethod · 0.80
infoMethod · 0.80

Tested by

no test coverage detected