Skip to content

Commit

Permalink
Merge pull request #1418 from PyWoody/pickle_protocol
Browse files Browse the repository at this point in the history
pickle objects are now dumped with pickle.HIGHEST_PROTOCOL
  • Loading branch information
serengil authored Jan 6, 2025
2 parents c465234 + 4255b41 commit fea8b11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deepface/modules/recognition.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def find(
# Ensure the proper pickle file exists
if not os.path.exists(datastore_path):
with open(datastore_path, "wb") as f:
pickle.dump([], f)
pickle.dump([], f, pickle.HIGHEST_PROTOCOL)

# Load the representations from the pickle file
with open(datastore_path, "rb") as f:
Expand Down Expand Up @@ -232,7 +232,7 @@ def find(

if must_save_pickle:
with open(datastore_path, "wb") as f:
pickle.dump(representations, f)
pickle.dump(representations, f, pickle.HIGHEST_PROTOCOL)
if not silent:
logger.info(f"There are now {len(representations)} representations in {file_name}")

Expand Down

0 comments on commit fea8b11

Please sign in to comment.