mirror of
https://github.com/serengil/deepface.git
synced 2025-07-24 19:00:07 +00:00
pickled_images is now created using a set comprehension, instead of a list comprehension as before. Like storage_images, all subsequent actions where set and not list actions, so it saves time re-creating the list as a set later on.
This commit is contained in:
parent
2ee02e0003
commit
799cb0f6cf
@ -165,7 +165,7 @@ def find(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# embedded images
|
# embedded images
|
||||||
pickled_images = [representation["identity"] for representation in representations]
|
pickled_images = {representation["identity"] for representation in representations}
|
||||||
|
|
||||||
# Get the list of images on storage
|
# Get the list of images on storage
|
||||||
storage_images = set(image_utils.yield_images(path=db_path))
|
storage_images = set(image_utils.yield_images(path=db_path))
|
||||||
@ -186,8 +186,8 @@ def find(
|
|||||||
|
|
||||||
# Enforce data consistency amongst on disk images and pickle file
|
# Enforce data consistency amongst on disk images and pickle file
|
||||||
if refresh_database:
|
if refresh_database:
|
||||||
new_images = storage_images - set(pickled_images) # images added to storage
|
new_images = storage_images - pickled_images # images added to storage
|
||||||
old_images = set(pickled_images) - storage_images # images removed from storage
|
old_images = pickled_images - storage_images # images removed from storage
|
||||||
|
|
||||||
# detect replaced images
|
# detect replaced images
|
||||||
for current_representation in representations:
|
for current_representation in representations:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user