Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,8 @@ import sys
|
|
3 |
from torchvision.transforms import functional
|
4 |
sys.modules["torchvision.transforms.functional_tensor"] = functional
|
5 |
|
|
|
|
|
6 |
from basicsr.archs.srvgg_arch import SRVGGNetCompact
|
7 |
from gfpgan.utils import GFPGANer
|
8 |
from realesrgan.utils import RealESRGANer
|
@@ -33,6 +35,7 @@ upsampler = RealESRGANer(scale=4, model_path=model_path, model=model, tile=0, ti
|
|
33 |
# ์ด๋ฏธ์ง ์ ์ฅ ๋๋ ํ ๋ฆฌ ์์ฑ (ํ์์ ์ฃผ์ ํด์ )
|
34 |
# os.makedirs('output', exist_ok=True)
|
35 |
|
|
|
36 |
def upscaler(img, version, scale):
|
37 |
try:
|
38 |
# ์
๋ ฅ๋ img๋ ํ์ผ ๊ฒฝ๋ก์
|
|
|
3 |
from torchvision.transforms import functional
|
4 |
sys.modules["torchvision.transforms.functional_tensor"] = functional
|
5 |
|
6 |
+
import spaces
|
7 |
+
|
8 |
from basicsr.archs.srvgg_arch import SRVGGNetCompact
|
9 |
from gfpgan.utils import GFPGANer
|
10 |
from realesrgan.utils import RealESRGANer
|
|
|
35 |
# ์ด๋ฏธ์ง ์ ์ฅ ๋๋ ํ ๋ฆฌ ์์ฑ (ํ์์ ์ฃผ์ ํด์ )
|
36 |
# os.makedirs('output', exist_ok=True)
|
37 |
|
38 |
+
@spaces.GPU(duration=120)
|
39 |
def upscaler(img, version, scale):
|
40 |
try:
|
41 |
# ์
๋ ฅ๋ img๋ ํ์ผ ๊ฒฝ๋ก์
|