Remove any person which does not have images for all categories

This commit is contained in:
mrt
2023-09-12 14:53:43 +02:00
committed by Marcos Rodrigo
parent d76270fd1c
commit 87cb0ae9b9

View File

@@ -47,6 +47,14 @@ def get_histogram():
for item in sunglasses_items:
name = item.split('_wearing_sunglasses')[0]
data[name]['Sunglasses'] = len(os.listdir(f"{SUNGLASSES_DIR}/{item}"))
# Remove any person which does not have images for all categories
data_aux = data.copy()
for name in data.keys():
if any(val is None for val in data[name].values()):
data_aux.pop(name)
data = data_aux.copy()
return data