From 56d3b66a5cf08484c5975d48f3ab6ccf63d32310 Mon Sep 17 00:00:00 2001 From: "Samuel J. Woodward" Date: Mon, 6 Jan 2025 09:15:38 -0500 Subject: [PATCH] df_cols is now created as a set. All operations were already set operations on the object. If the order of the columns will need to be maintained in future versions, this should be restored to the original list. --- deepface/modules/recognition.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deepface/modules/recognition.py b/deepface/modules/recognition.py index d964693..fc6f35b 100644 --- a/deepface/modules/recognition.py +++ b/deepface/modules/recognition.py @@ -136,7 +136,7 @@ def find( representations = [] # required columns for representations - df_cols = [ + df_cols = { "identity", "hash", "embedding", @@ -144,7 +144,7 @@ def find( "target_y", "target_w", "target_h", - ] + } # Ensure the proper pickle file exists if not os.path.exists(datastore_path): @@ -157,7 +157,7 @@ def find( # check each item of representations list has required keys for i, current_representation in enumerate(representations): - missing_keys = set(df_cols) - set(current_representation.keys()) + missing_keys = df_cols - set(current_representation.keys()) if len(missing_keys) > 0: raise ValueError( f"{i}-th item does not have some required keys - {missing_keys}."