inspiration perfected

This commit is contained in:
yfszzx 2022-10-22 10:21:21 +08:00
parent 40ddb6df61
commit d93ea5cdeb

View file

@ -73,8 +73,11 @@ def get_inspiration_images(source, types, keyword):
image_list = []
for a in names:
image_path = os.path.join(opts.inspiration_dir, a)
images = os.listdir(image_path)
image_list.append((os.path.join(image_path, random.choice(images)), a))
images = os.listdir(image_path)
if len(images) > 0:
image_list.append((os.path.join(image_path, random.choice(images)), a))
else:
print(image_path)
return image_list, names
def select_click(index, name_list):