File size: 313 Bytes
32b45ca 06c5939 32b45ca 06c5939 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import os
import random
from PIL import Image
__all__ = ["background_image_generator"]
def background_image_generator(path="./dataset/pixivimages"):
image_list = os.listdir(path)
image_list = [os.path.join(path, image) for image in image_list]
while True:
yield random.choice(image_list)
|