feng2022 commited on
Commit
9054fd3
1 Parent(s): 3ce9990

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -59,8 +59,8 @@ def generate_image(seed: int, truncation_psi: float, model: nn.Module,
59
  return out[0].cpu().numpy()
60
 
61
 
62
- def load_model(file_name: str, device: torch.device) -> nn.Module:
63
- path = hf_hub_download('feng2022/Time-TravelRephotography',
64
  f'{file_name}',
65
  use_auth_token=TOKEN)
66
  with open(path, 'rb') as f:
@@ -78,7 +78,7 @@ def main():
78
  args = parse_args()
79
  device = torch.device(args.device)
80
 
81
- model = load_model('stylegan_human_v2_1024.pkl', device)
82
 
83
  func = functools.partial(generate_image, model=model, device=device)
84
  func = functools.update_wrapper(func, generate_image)
 
59
  return out[0].cpu().numpy()
60
 
61
 
62
+ def load_model(file_name: str, path:str, device: torch.device) -> nn.Module:
63
+ path = hf_hub_download(f'{path}',
64
  f'{file_name}',
65
  use_auth_token=TOKEN)
66
  with open(path, 'rb') as f:
 
78
  args = parse_args()
79
  device = torch.device(args.device)
80
 
81
+ model_e4e = load_model('e4e_ffhq_encode.pt',"feng2022/Time-TravelRephotography_e4e_ffhq_encode", device)
82
 
83
  func = functools.partial(generate_image, model=model, device=device)
84
  func = functools.update_wrapper(func, generate_image)