feng2022 commited on
Commit
7a47d07
1 Parent(s): 701eba9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -64,6 +64,7 @@ def image_create(input_img):
64
  log_visual_freq=1000,
65
  input='text',
66
  )
 
67
  generator = create_generator("stylegan2-ffhq-config-f.pt","feng2022/Time-TravelRephotography_stylegan2-ffhq-config-f",args,device)
68
  latent = torch.randn((1, 512), device=device)
69
  img_out, _, _ = generator([latent])
@@ -82,7 +83,7 @@ def main():
82
  func = functools.partial(image_create, device=device)
83
  func = functools.update_wrapper(func, image_create)
84
  iface = gr.Interface(
85
- func,
86
  [
87
  gr.inputs.Number(default=0, label='Seed'),
88
  gr.inputs.Slider(
 
64
  log_visual_freq=1000,
65
  input='text',
66
  )
67
+ device = th.device()
68
  generator = create_generator("stylegan2-ffhq-config-f.pt","feng2022/Time-TravelRephotography_stylegan2-ffhq-config-f",args,device)
69
  latent = torch.randn((1, 512), device=device)
70
  img_out, _, _ = generator([latent])
 
83
  func = functools.partial(image_create, device=device)
84
  func = functools.update_wrapper(func, image_create)
85
  iface = gr.Interface(
86
+ image_create,
87
  [
88
  gr.inputs.Number(default=0, label='Seed'),
89
  gr.inputs.Slider(