Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,19 @@ from gfpgan.utils import GFPGANer
|
|
7 |
from realesrgan.utils import RealESRGANer
|
8 |
import uuid
|
9 |
import tempfile
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
app = Flask(__name__)
|
12 |
|
@@ -205,18 +218,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=7860, debug=True)
|
|
|
7 |
from realesrgan.utils import RealESRGANer
|
8 |
import uuid
|
9 |
import tempfile
|
10 |
+
# ウェイトファイルをダウンロード(存在しない場合)
|
11 |
+
if not os.path.exists('realesr-general-x4v3.pth'):
|
12 |
+
os.system("wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth -P .")
|
13 |
+
if not os.path.exists('GFPGANv1.2.pth'):
|
14 |
+
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.2.pth -P .")
|
15 |
+
if not os.path.exists('GFPGANv1.3.pth'):
|
16 |
+
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -P .")
|
17 |
+
if not os.path.exists('GFPGANv1.4.pth'):
|
18 |
+
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth -P .")
|
19 |
+
if not os.path.exists('RestoreFormer.pth'):
|
20 |
+
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/RestoreFormer.pth -P .")
|
21 |
+
if not os.path.exists('CodeFormer.pth'):
|
22 |
+
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/CodeFormer.pth -P .")
|
23 |
|
24 |
app = Flask(__name__)
|
25 |
|
|
|
218 |
"""
|
219 |
|
220 |
if __name__ == '__main__':
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
|
222 |
app.run(host='0.0.0.0', port=7860, debug=True)
|