akiyamasho commited on
Commit
31256e3
1 Parent(s): 56358da

MAINT: put back vars

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -38,11 +38,10 @@ MODEL_FILE_MIYAZAKI = "miyazaki_hayao.pth"
38
  MODEL_FILE_KON = "kon_satoshi.pth"
39
 
40
  # Model Initalisation
41
-
42
- shinkai_model_hfhub = hf_hub_download(repo_id="akiyamasho/AnimeBackgroundGAN", filename="shinkai_makoto.pth")
43
- hosoda_model_hfhub = hf_hub_download(repo_id="akiyamasho/AnimeBackgroundGAN", filename="hosoda_mamoru.pth")
44
- miyazaki_model_hfhub = hf_hub_download(repo_id="akiyamasho/AnimeBackgroundGAN", filename="miyazaki_hayao.pth")
45
- kon_model_hfhub = hf_hub_download(repo_id="akiyamasho/AnimeBackgroundGAN", filename="kon_satoshi.pth")
46
 
47
  shinkai_model = Transformer()
48
  hosoda_model = Transformer()
@@ -70,6 +69,7 @@ hosoda_model.eval()
70
  miyazaki_model.eval()
71
  kon_model.eval()
72
 
 
73
 
74
  def get_model(style):
75
  if style == STYLE_SHINKAI:
@@ -126,6 +126,8 @@ def inference(img, style):
126
  return transforms.ToPILImage()(output_image)
127
 
128
 
 
 
129
  title = "Anime Background GAN"
130
  description = "Gradio Demo for CartoonGAN by Chen Et. Al. Models are Shinkai Makoto, Hosoda Mamoru, Kon Satoshi, and Miyazaki Hayao."
131
  article = "<p style='text-align: center'><a href='http://openaccess.thecvf.com/content_cvpr_2018/CameraReady/2205.pdf' target='_blank'>CartoonGAN Whitepaper from Chen et.al</a></p><p style='text-align: center'><a href='https://github.com/venture-anime/cartoongan-pytorch' target='_blank'>Github Repo</a></p><p style='text-align: center'><a href='https://github.com/Yijunmaverick/CartoonGAN-Test-Pytorch-Torch' target='_blank'>Original Implementation from Yijunmaverick</a></p><center><img src='https://visitor-badge.glitch.me/badge?page_id=akiyamasho' alt='visitor badge'></center></p>"
 
38
  MODEL_FILE_KON = "kon_satoshi.pth"
39
 
40
  # Model Initalisation
41
+ shinkai_model_hfhub = hf_hub_download(repo_id=MODEL_REPO_ID, filename=MODEL_FILE_SHINKAI)
42
+ hosoda_model_hfhub = hf_hub_download(repo_id=MODEL_REPO_ID, filename=MODEL_FILE_HOSODA)
43
+ miyazaki_model_hfhub = hf_hub_download(repo_id=MODEL_REPO_ID, filename=MODEL_FILE_MIYAZAKI)
44
+ kon_model_hfhub = hf_hub_download(repo_id=MODEL_REPO_ID, filename=MODEL_FILE_KON)
 
45
 
46
  shinkai_model = Transformer()
47
  hosoda_model = Transformer()
 
69
  miyazaki_model.eval()
70
  kon_model.eval()
71
 
72
+ # Functions
73
 
74
  def get_model(style):
75
  if style == STYLE_SHINKAI:
 
126
  return transforms.ToPILImage()(output_image)
127
 
128
 
129
+ # Gradio setup
130
+
131
  title = "Anime Background GAN"
132
  description = "Gradio Demo for CartoonGAN by Chen Et. Al. Models are Shinkai Makoto, Hosoda Mamoru, Kon Satoshi, and Miyazaki Hayao."
133
  article = "<p style='text-align: center'><a href='http://openaccess.thecvf.com/content_cvpr_2018/CameraReady/2205.pdf' target='_blank'>CartoonGAN Whitepaper from Chen et.al</a></p><p style='text-align: center'><a href='https://github.com/venture-anime/cartoongan-pytorch' target='_blank'>Github Repo</a></p><p style='text-align: center'><a href='https://github.com/Yijunmaverick/CartoonGAN-Test-Pytorch-Torch' target='_blank'>Original Implementation from Yijunmaverick</a></p><center><img src='https://visitor-badge.glitch.me/badge?page_id=akiyamasho' alt='visitor badge'></center></p>"