Spaces:
Running
Running
File size: 892 Bytes
380570c 4ef921e 629cc05 4ef921e 629cc05 4ef921e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# Provide paths to your test images
import os
import random
def get_image_names():
# Get background images
background_dir = "public/images/backgrounds"
background_images = [f for f in os.listdir(background_dir) if f.endswith(('.jpg', '.jpeg', '.png'))]
# Get people images
people_dir = "public/images/people"
people_images = [f for f in os.listdir(people_dir) if f.endswith(('.jpg', '.jpeg', '.png'))]
generate_testing_list = []
random.shuffle(background_images)
random.shuffle(people_images)
total_length = len(people_images)
# Get 10 random pairs
for background in background_images:
person = people_images[random.randint(0, total_length - 1)]
generate_testing_list.append(list(( os.path.join(people_dir, person), os.path.join(background_dir, background), 10, 100)))
return generate_testing_list
|