fffiloni commited on
Commit
b328128
1 Parent(s): 5f0cf71

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -20,12 +20,12 @@ device="cpu"
20
  source_img = gr.Image(source="upload", type="filepath", label="init_img")
21
  gallery = gr.Gallery(label="Generated images", show_label=False, elem_id="gallery").style(grid=[2], height="auto")
22
 
23
- def resize(width,img):
24
- basewidth = width
25
  img = Image.open(img)
26
- wpercent = (basewidth/float(img.size[0]))
27
- hsize = int((float(img.size[1])*float(wpercent)))
28
- img = img.resize((basewidth,hsize), Image.Resampling.LANCZOS)
29
  return img
30
 
31
 
 
20
  source_img = gr.Image(source="upload", type="filepath", label="init_img")
21
  gallery = gr.Gallery(label="Generated images", show_label=False, elem_id="gallery").style(grid=[2], height="auto")
22
 
23
+ def resize(height,img):
24
+ baseheight = height
25
  img = Image.open(img)
26
+ hpercent = (baseheight/float(img.size[1]))
27
+ wsize = int((float(img.size[0])*float(hpercent)))
28
+ img = img.resize((wsize,baseheight), Image.Resampling.LANCZOS)
29
  return img
30
 
31