mirror of
https://github.com/serengil/deepface.git
synced 2025-06-05 19:15:23 +00:00
storage_images is now built as a set with the new deepface.commons.image_utils.yield_images generator function. Previously, storage_images was created with deepface.commons.image_utils.list_images as a list, then converted to a set while never being used as purely a list.
This commit is contained in:
parent
9dc261b080
commit
2ee02e0003
@ -168,7 +168,7 @@ def find(
|
||||
pickled_images = [representation["identity"] for representation in representations]
|
||||
|
||||
# Get the list of images on storage
|
||||
storage_images = image_utils.list_images(path=db_path)
|
||||
storage_images = set(image_utils.yield_images(path=db_path))
|
||||
|
||||
if len(storage_images) == 0 and refresh_database is True:
|
||||
raise ValueError(f"No item found in {db_path}")
|
||||
@ -186,8 +186,8 @@ def find(
|
||||
|
||||
# Enforce data consistency amongst on disk images and pickle file
|
||||
if refresh_database:
|
||||
new_images = set(storage_images) - set(pickled_images) # images added to storage
|
||||
old_images = set(pickled_images) - set(storage_images) # images removed from storage
|
||||
new_images = storage_images - set(pickled_images) # images added to storage
|
||||
old_images = set(pickled_images) - storage_images # images removed from storage
|
||||
|
||||
# detect replaced images
|
||||
for current_representation in representations:
|
||||
|
Loading…
x
Reference in New Issue
Block a user