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

Function test_find_with_array_input

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

Source from the content-addressed store, hash-verified

47
48
49def test_find_with_array_input():
50 img_path = os.path.join("dataset", "img1.jpg")
51 img1 = cv2.imread(img_path)
52 dfs = DeepFace.find(img1, db_path="dataset", silent=True)
53 assert len(dfs) > 0
54 for df in dfs:
55 assert isinstance(df, pd.DataFrame)
56
57 # one is img1.jpg itself
58 identity_df = df[df["identity"] == img_path]
59 assert identity_df.shape[0] > 0
60
61 # validate reproducability
62 assert identity_df["distance"].values[0] < threshold
63
64 df = df[df["identity"] != img_path]
65 logger.debug(df.head())
66 assert df.shape[0] > 0
67
68 logger.info("✅ test find for array input done")
69
70
71def test_find_with_extracted_faces():

Callers

nothing calls this directly

Calls 2

debugMethod · 0.80
infoMethod · 0.80

Tested by

no test coverage detected