gyrojeff commited on
Commit
32b45ca
1 Parent(s): e8cd6a9

feat: add background generator

Browse files
Files changed (1) hide show
  1. font_dataset/background.py +14 -0
font_dataset/background.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from PIL import Image
3
+
4
+
5
+ __all__ = ["background_image_generator"]
6
+
7
+
8
+ def background_image_generator(path="./dataset/pixivimages"):
9
+ image_list = os.listdir(path)
10
+ image_list = [os.path.join(path, image) for image in image_list]
11
+
12
+ while True:
13
+ for image in image_list:
14
+ yield image