sashavor commited on
Commit
b9f612c
1 Parent(s): bd0bfbc

keeping portrait part

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,20 +3,20 @@ import random, os
3
  from PIL import Image
4
 
5
  def open_ims(choice):
6
- dirname='images/'+'Photo_portrait_of_a_'+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/'+'Photo_portrait_of_a_'+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('Photo_portrait_of_a_','').replace('_',' ') for c in categories]
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: