ciCic commited on
Commit
0605ecd
·
verified ·
1 Parent(s): a8b6bb3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -13,7 +13,7 @@ vae = AutoencoderTiny.from_pretrained(model_id, safetensors=True).to(device)
13
 
14
  @torch.no_grad()
15
  def encode(image):
16
- DIM = 512
17
  processed = center_crop(resize(image, DIM), DIM)
18
  tensor = to_tensor(processed).unsqueeze(0).to(device)
19
  latents = vae.encoder(tensor)
@@ -27,7 +27,6 @@ astronaut = os.path.join(os.path.dirname(__file__), "images/6.png")
27
  def app():
28
  return gr.Interface(encode,
29
  gr.Image(type="pil",
30
- mirror_webcam=False,
31
  label='512x512',
32
  value=astronaut),
33
  gr.Image(type="pil",
@@ -40,7 +39,7 @@ def app():
40
  astronaut,
41
  os.path.join(os.path.dirname(__file__), "images/7.png"),
42
  os.path.join(os.path.dirname(__file__), "images/34.png")
43
- ], allow_flagging='never', title='Image Encoder')
44
 
45
 
46
  if __name__ == "__main__":
 
13
 
14
  @torch.no_grad()
15
  def encode(image):
16
+ DIM = [512]
17
  processed = center_crop(resize(image, DIM), DIM)
18
  tensor = to_tensor(processed).unsqueeze(0).to(device)
19
  latents = vae.encoder(tensor)
 
27
  def app():
28
  return gr.Interface(encode,
29
  gr.Image(type="pil",
 
30
  label='512x512',
31
  value=astronaut),
32
  gr.Image(type="pil",
 
39
  astronaut,
40
  os.path.join(os.path.dirname(__file__), "images/7.png"),
41
  os.path.join(os.path.dirname(__file__), "images/34.png")
42
+ ], flagging_mode='never', title='Image Encoder')
43
 
44
 
45
  if __name__ == "__main__":