Update app.py
Browse files
app.py
CHANGED
@@ -1,19 +1,5 @@
|
|
1 |
import sys
|
2 |
import os
|
3 |
-
import cv2
|
4 |
-
import torch
|
5 |
-
from flask import Flask, request, jsonify, send_file
|
6 |
-
from basicsr.archs.srvgg_arch import SRVGGNetCompact
|
7 |
-
from gfpgan.utils import GFPGANer
|
8 |
-
from realesrgan.utils import RealESRGANer
|
9 |
-
import uuid
|
10 |
-
import tempfile
|
11 |
-
from torchvision.transforms.functional import normalize
|
12 |
-
from torchvision import transforms
|
13 |
-
from PIL import Image
|
14 |
-
from basicsr.utils import img2tensor, tensor2img
|
15 |
-
from facexlib.utils.face_restoration_helper import FaceRestoreHelper
|
16 |
-
from codeformer.archs.codeformer_arch import CodeFormer
|
17 |
|
18 |
# 依存関係のインストール
|
19 |
os.system("git clone https://github.com/sczhou/CodeFormer.git")
|
@@ -35,6 +21,21 @@ if not os.path.exists('RestoreFormer.pth'):
|
|
35 |
if not os.path.exists('CodeFormer.pth'):
|
36 |
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/CodeFormer.pth -P .")
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
app = Flask(__name__)
|
39 |
|
40 |
# モデルの初期化
|
|
|
1 |
import sys
|
2 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
# 依存関係のインストール
|
5 |
os.system("git clone https://github.com/sczhou/CodeFormer.git")
|
|
|
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 |
+
import cv2
|
25 |
+
import torch
|
26 |
+
from flask import Flask, request, jsonify, send_file
|
27 |
+
from basicsr.archs.srvgg_arch import SRVGGNetCompact
|
28 |
+
from gfpgan.utils import GFPGANer
|
29 |
+
from realesrgan.utils import RealESRGANer
|
30 |
+
import uuid
|
31 |
+
import tempfile
|
32 |
+
from torchvision.transforms.functional import normalize
|
33 |
+
from torchvision import transforms
|
34 |
+
from PIL import Image
|
35 |
+
from basicsr.utils import img2tensor, tensor2img
|
36 |
+
from facexlib.utils.face_restoration_helper import FaceRestoreHelper
|
37 |
+
from codeformer.archs.codeformer_arch import CodeFormer
|
38 |
+
|
39 |
app = Flask(__name__)
|
40 |
|
41 |
# モデルの初期化
|