SerdarHelli commited on
Commit
584eca0
1 Parent(s): b33d32a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -14,6 +14,7 @@ import subprocess
14
  import os
15
  from typing import Tuple
16
  import PIL.Image
 
17
 
18
  os.system("git clone https://github.com/NVlabs/stylegan3")
19
 
@@ -26,10 +27,10 @@ DESCRIPTION = f'''This model generates healthy MR Brain Images.
26
 
27
  [Example]("https://huggingface.co/spaces/SerdarHelli/Brain-MR-Image-Generation-GAN/blob/main/ex.png")
28
  '''
 
29
 
30
 
31
-
32
- network_pkl='braingan-400.pkl'
33
  with open(network_pkl, 'rb') as f:
34
  G = pickle.load(f)['G_ema']
35
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
 
14
  import os
15
  from typing import Tuple
16
  import PIL.Image
17
+ from huggingface_hub import hf_hub_download
18
 
19
  os.system("git clone https://github.com/NVlabs/stylegan3")
20
 
 
27
 
28
  [Example]("https://huggingface.co/spaces/SerdarHelli/Brain-MR-Image-Generation-GAN/blob/main/ex.png")
29
  '''
30
+ hf_hub_download("SerdarHelli/Brain-MRI-GAN", filename="brainmrigan.pkl")
31
 
32
 
33
+ network_pkl='brainmrigan.pkl'
 
34
  with open(network_pkl, 'rb') as f:
35
  G = pickle.load(f)['G_ema']
36
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")