Update app.py
Browse files
app.py
CHANGED
@@ -87,11 +87,11 @@ def convert(img, model, scale):
|
|
87 |
os.makedirs('output', exist_ok=True)
|
88 |
|
89 |
MODEL_PATH = {
|
90 |
-
"
|
91 |
-
"
|
92 |
-
"
|
93 |
-
"
|
94 |
-
"
|
95 |
}
|
96 |
|
97 |
|
@@ -106,34 +106,35 @@ def inference(img_path, model, focus_face=None):
|
|
106 |
### Layout ###
|
107 |
|
108 |
title = "AnimeGANv2: To produce your own animation 😶🌫️"
|
109 |
-
description = r"""
|
|
|
110 |
#### How to use:
|
111 |
-
* Upload your image
|
112 |
-
* Select the style,
|
113 |
-
* Choice of whether to extract the face.(Warning: Yes if there is a face in the image)
|
114 |
"""
|
115 |
article = r"""
|
116 |
<center><img src='https://visitor-badge.glitch.me/badge?page_id=AnimeGAN_demo&left_color=green&right_color=blue' alt='visitor badge'></center>
|
117 |
<center><a href='https://github.com/TachibanaYoshino/AnimeGANv3' target='_blank'>Github Repo</a></center>
|
118 |
"""
|
119 |
-
examples=[['sample1.jpg', '
|
120 |
-
['sample2.jpg', '
|
121 |
-
['sample3.jpg', '
|
122 |
-
['sample4.jpeg', '
|
123 |
-
['sample5.jpg', '
|
124 |
-
['sample6.jpeg', '
|
125 |
gr.Interface(
|
126 |
inference, [
|
127 |
gr.Image(type="filepath", label="Input image"),
|
128 |
gr.Dropdown([
|
129 |
-
'
|
130 |
-
'
|
131 |
-
'
|
132 |
-
'
|
133 |
-
'
|
134 |
],
|
135 |
type="value",
|
136 |
-
value='
|
137 |
label='AnimeGAN Style'),
|
138 |
gr.Radio(['Yes', 'No'], type="value", value='No', label='Extract face'),
|
139 |
], [
|
|
|
87 |
os.makedirs('output', exist_ok=True)
|
88 |
|
89 |
MODEL_PATH = {
|
90 |
+
"Hayao": hf_hub_download('vumichien/AnimeGANv2_Hayao', 'AnimeGANv2_Hayao.onnx'),
|
91 |
+
"Shinkai": hf_hub_download('vumichien/AnimeGANv2_Shinkai', 'AnimeGANv2_Shinkai.onnx'),
|
92 |
+
"Paprika": hf_hub_download('vumichien/AnimeGANv2_Paprika', 'AnimeGANv2_Paprika.onnx'),
|
93 |
+
"PortraitSketch": hf_hub_download('vumichien/AnimeGANv3_PortraitSketch', 'AnimeGANv3_PortraitSketch.onnx'),
|
94 |
+
"JP_face": hf_hub_download('vumichien/AnimeGANv3_JP_face', 'AnimeGANv3_JP_face.onnx'),
|
95 |
}
|
96 |
|
97 |
|
|
|
106 |
### Layout ###
|
107 |
|
108 |
title = "AnimeGANv2: To produce your own animation 😶🌫️"
|
109 |
+
description = r"""
|
110 |
+
### 🔥Demo AnimeGANv2: To produce your own animation. <br>
|
111 |
#### How to use:
|
112 |
+
* 1. Upload your image
|
113 |
+
* 2. Select the style (For human: PortraitSketch, JP_face; For scene: Hayao, Shinkai, Paprika)
|
114 |
+
* 3. Choice of whether to extract the face.(Warning: Yes if there is a face in the image)
|
115 |
"""
|
116 |
article = r"""
|
117 |
<center><img src='https://visitor-badge.glitch.me/badge?page_id=AnimeGAN_demo&left_color=green&right_color=blue' alt='visitor badge'></center>
|
118 |
<center><a href='https://github.com/TachibanaYoshino/AnimeGANv3' target='_blank'>Github Repo</a></center>
|
119 |
"""
|
120 |
+
examples=[['sample1.jpg', 'PortraitSketch', "Yes"],
|
121 |
+
['sample2.jpg', 'PortraitSketch', "No"],
|
122 |
+
['sample3.jpg', 'Hayao', "No"],
|
123 |
+
['sample4.jpeg', 'Shinkai', "No"],
|
124 |
+
['sample5.jpg', 'Paprika', "No"],
|
125 |
+
['sample6.jpeg', 'JP_face', "No"]]
|
126 |
gr.Interface(
|
127 |
inference, [
|
128 |
gr.Image(type="filepath", label="Input image"),
|
129 |
gr.Dropdown([
|
130 |
+
'Hayao',
|
131 |
+
'Shinkai',
|
132 |
+
'Paprika',
|
133 |
+
'PortraitSketch',
|
134 |
+
'JP_face',
|
135 |
],
|
136 |
type="value",
|
137 |
+
value='PortraitSketch',
|
138 |
label='AnimeGAN Style'),
|
139 |
gr.Radio(['Yes', 'No'], type="value", value='No', label='Extract face'),
|
140 |
], [
|