I have a list of images that I am repeatedly calling the same functions for:
first_image = load_image("test1.jpg")
first_image_encoding = pic_encoding(first_image)[0]
second_image = load_image("test2.jpg")
second_image_encoding = pic_encoding(second_image)[0]
After which I need to populate them into an array like this:
encoding_arr = [
first_image_encoding,
second_image_encoding
]
I am trying to do all of this dynamically but need help with the first part for assigning unique variable names to assigned values.
Here is what I have so far:
for root, dirs, files in os.walk(img_dir):
for f in files:
first_image = load_image(f)
first_image_encoding = pic_encoding(first_image)[0]
I am not sure how to get a list of unique variables here instead of manually hard coding them