eliphatfs commited on
Commit
1059e8f
1 Parent(s): d56acb1

Add resolution pre-downscaling.

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -233,6 +233,11 @@ with results_container:
233
  seed = int(seed)
234
  torch.manual_seed(seed)
235
  img = Image.open(pic)
 
 
 
 
 
236
  left, right = st.columns(2)
237
  with left:
238
  st.image(img)
 
233
  seed = int(seed)
234
  torch.manual_seed(seed)
235
  img = Image.open(pic)
236
+ if max(img.size) > 1280:
237
+ w, h = img.size
238
+ w = round(1280 / max(img.size) * w)
239
+ h = round(1280 / max(img.size) * h)
240
+ img = img.resize((w, h))
241
  left, right = st.columns(2)
242
  with left:
243
  st.image(img)