sashavor
commited on
Commit
•
b9f612c
1
Parent(s):
bd0bfbc
keeping portrait part
Browse files
app.py
CHANGED
@@ -3,20 +3,20 @@ import random, os
|
|
3 |
from PIL import Image
|
4 |
|
5 |
def open_ims(choice):
|
6 |
-
dirname='images/'+
|
7 |
imnames= os.listdir(dirname)
|
8 |
images = [(Image.open(dirname+name)) for name in imnames]
|
9 |
return images[:9]
|
10 |
|
11 |
def random_image():
|
12 |
cat = random.choice(categories)
|
13 |
-
dirname = 'images/'+
|
14 |
imnames = os.listdir(dirname)
|
15 |
images = [(Image.open(dirname+name)) for name in imnames]
|
16 |
return images[:9]
|
17 |
|
18 |
categories=os.listdir('images/')
|
19 |
-
categories = [c.replace('
|
20 |
seeds = [46267, 48040, 51237, 54325, 60884, 64830, 67031, 72935, 92118, 93109]
|
21 |
|
22 |
with gr.Blocks() as demo:
|
|
|
3 |
from PIL import Image
|
4 |
|
5 |
def open_ims(choice):
|
6 |
+
dirname='images/'+choice.replace(' ','_')+'/Seed_'+ str(seed_choice)+'/'
|
7 |
imnames= os.listdir(dirname)
|
8 |
images = [(Image.open(dirname+name)) for name in imnames]
|
9 |
return images[:9]
|
10 |
|
11 |
def random_image():
|
12 |
cat = random.choice(categories)
|
13 |
+
dirname = 'images/'+cat.replace(' ','_')+'/Seed_'+str(seed_choice)+'/'
|
14 |
imnames = os.listdir(dirname)
|
15 |
images = [(Image.open(dirname+name)) for name in imnames]
|
16 |
return images[:9]
|
17 |
|
18 |
categories=os.listdir('images/')
|
19 |
+
categories = [c.replace('_',' ') for c in categories]
|
20 |
seeds = [46267, 48040, 51237, 54325, 60884, 64830, 67031, 72935, 92118, 93109]
|
21 |
|
22 |
with gr.Blocks() as demo:
|