Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,19 @@ import uuid
|
|
9 |
import tempfile
|
10 |
|
11 |
app = Flask(__name__)
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
# モデルの初期化
|
14 |
model = SRVGGNetCompact(num_in_ch=3, num_out_ch=3, num_feat=64, num_conv=32, upscale=4, act_type='prelu')
|
15 |
model_path = 'realesr-general-x4v3.pth'
|
@@ -205,18 +217,5 @@ def index():
|
|
205 |
"""
|
206 |
|
207 |
if __name__ == '__main__':
|
208 |
-
# ウェイトファイルをダウンロード(存在しない場合)
|
209 |
-
if not os.path.exists('realesr-general-x4v3.pth'):
|
210 |
-
os.system("wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth -P .")
|
211 |
-
if not os.path.exists('GFPGANv1.2.pth'):
|
212 |
-
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.2.pth -P .")
|
213 |
-
if not os.path.exists('GFPGANv1.3.pth'):
|
214 |
-
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -P .")
|
215 |
-
if not os.path.exists('GFPGANv1.4.pth'):
|
216 |
-
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth -P .")
|
217 |
-
if not os.path.exists('RestoreFormer.pth'):
|
218 |
-
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/RestoreFormer.pth -P .")
|
219 |
-
if not os.path.exists('CodeFormer.pth'):
|
220 |
-
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/CodeFormer.pth -P .")
|
221 |
|
222 |
app.run(host='0.0.0.0', port=5000, debug=True)
|
|
|
9 |
import tempfile
|
10 |
|
11 |
app = Flask(__name__)
|
12 |
+
# ウェイトファイルをダウンロード(存在しない場合)
|
13 |
+
if not os.path.exists('realesr-general-x4v3.pth'):
|
14 |
+
os.system("wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth -P .")
|
15 |
+
if not os.path.exists('GFPGANv1.2.pth'):
|
16 |
+
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.2.pth -P .")
|
17 |
+
if not os.path.exists('GFPGANv1.3.pth'):
|
18 |
+
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -P .")
|
19 |
+
if not os.path.exists('GFPGANv1.4.pth'):
|
20 |
+
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth -P .")
|
21 |
+
if not os.path.exists('RestoreFormer.pth'):
|
22 |
+
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/RestoreFormer.pth -P .")
|
23 |
+
if not os.path.exists('CodeFormer.pth'):
|
24 |
+
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/CodeFormer.pth -P .")
|
25 |
# モデルの初期化
|
26 |
model = SRVGGNetCompact(num_in_ch=3, num_out_ch=3, num_feat=64, num_conv=32, upscale=4, act_type='prelu')
|
27 |
model_path = 'realesr-general-x4v3.pth'
|
|
|
217 |
"""
|
218 |
|
219 |
if __name__ == '__main__':
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
|
221 |
app.run(host='0.0.0.0', port=5000, debug=True)
|