Spaces:
Build error
Build error
akiyamasho
commited on
Commit
·
56358da
1
Parent(s):
3d6551f
MAINT: test without vars
Browse files
app.py
CHANGED
@@ -38,10 +38,11 @@ MODEL_FILE_MIYAZAKI = "miyazaki_hayao.pth"
|
|
38 |
MODEL_FILE_KON = "kon_satoshi.pth"
|
39 |
|
40 |
# Model Initalisation
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
45 |
|
46 |
shinkai_model = Transformer()
|
47 |
hosoda_model = Transformer()
|
@@ -69,7 +70,6 @@ hosoda_model.eval()
|
|
69 |
miyazaki_model.eval()
|
70 |
kon_model.eval()
|
71 |
|
72 |
-
# Functions
|
73 |
|
74 |
def get_model(style):
|
75 |
if style == STYLE_SHINKAI:
|
@@ -126,8 +126,6 @@ def inference(img, style):
|
|
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>"
|
|
|
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 |
miyazaki_model.eval()
|
71 |
kon_model.eval()
|
72 |
|
|
|
73 |
|
74 |
def get_model(style):
|
75 |
if style == STYLE_SHINKAI:
|
|
|
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>"
|